21-07-20, 12:57 AM
(آخر تعديل لهذه المشاركة : 21-07-20, 12:58 AM {2} بواسطة عبدالكريم رشدان.)
For i As Integer = 0 To FlowLayoutPanel1.Controls.Count - 1
Dim Cmd As New OleDbCommand("INSERT INTO tbl_order (nama,sla,seil) Values (@nama,@sla,@seil)", conn)
If conn.State = ConnectionState.Closed Then
conn.Open()
End If
Cmd.Parameters.AddWithValue("@nama", FlowLayoutPanel1.Controls(i).Controls("label1").Text)
Cmd.Parameters.AddWithValue("@sla", FlowLayoutPanel1.Controls(i).Controls("label2").Text)
Cmd.Parameters.AddWithValue("@seil", FlowLayoutPanel1.Controls(i).Controls("label3").Text)
Cmd.ExecuteNonQuery()
'Cmd.Dispose()
If conn.State = ConnectionState.Open Then
conn.Close()
End If
Next
MsgBox("تم ارسال الطلبية بنجاح", 64, "نظام الموفر")
'Catch ex As Exception
' MsgBox(ex.Message)
' Exit Sub
'End Try
End Sub
Dim Cmd As New OleDbCommand("INSERT INTO tbl_order (nama,sla,seil) Values (@nama,@sla,@seil)", conn)
If conn.State = ConnectionState.Closed Then
conn.Open()
End If
Cmd.Parameters.AddWithValue("@nama", FlowLayoutPanel1.Controls(i).Controls("label1").Text)
Cmd.Parameters.AddWithValue("@sla", FlowLayoutPanel1.Controls(i).Controls("label2").Text)
Cmd.Parameters.AddWithValue("@seil", FlowLayoutPanel1.Controls(i).Controls("label3").Text)
Cmd.ExecuteNonQuery()
'Cmd.Dispose()
If conn.State = ConnectionState.Open Then
conn.Close()
End If
Next
MsgBox("تم ارسال الطلبية بنجاح", 64, "نظام الموفر")
'Catch ex As Exception
' MsgBox(ex.Message)
' Exit Sub
'End Try
End Sub
