السلام عليكم ورحمته الله وبركاته
مشكلتى هو عند مقارنه التاريخ يظهر رساله ان التاريخ النهاية اصغر من تاريخ البدايه حتى لو التاريخ صح
For x As Integer = 0 To DataGridView1.Rows.Count - 1
If DataGridView1.Rows(x).Cells(1).Value < DataGridView1.Rows(x).Cells(2).Value Then
If cn.State = ConnectionState.Open Then cn.Close()
cn.Open()
Dim id As Integer
Dim name, sal_name, notes As String
Dim start, end1 As DateTime
id = Val(TextBox1.Text)
name = TextBox2.Text
sal_name = DataGridView1.Rows.Item(x).Cells(0).Value
start = DataGridView1.Rows.Item(x).Cells(1).Value
end1 = DataGridView1.Rows.Item(x).Cells(2).Value
notes = DataGridView1.Rows.Item(x).Cells(3).Value
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "insertsal_emp"
cmd.Parameters.Add("@id", SqlDbType.Int).Value = TextBox1.Text
cmd.Parameters.Add("@name", SqlDbType.VarChar).Value = TextBox2.Text
cmd.Parameters.Add("@sal_name", SqlDbType.VarChar).Value = DataGridView1.CurrentRow.Cells(0).Value
cmd.Parameters.Add("@start", SqlDbType.DateTime).Value = DataGridView1.CurrentRow.Cells(1).Value
cmd.Parameters.Add("@end1", SqlDbType.DateTime).Value = DataGridView1.CurrentRow.Cells(2).Value
cmd.Parameters.Add("@notes", SqlDbType.VarChar).Value = DataGridView1.CurrentRow.Cells(3).Value
cmd.ExecuteNonQuery()
MessageBox.Show("تم الحفظ ")
Else
MessageBox.Show("تاريخ النهاية اضغر من تاريخ البداية ")
End If
Nextيتم اظهار رساله تم الحفظ ثم تاريخ النهاية اضغر من تاريخ البدايه ثم هذا الخطا
Procedure or function insertsal_emp has too many arguments specified.
وشكرا