22-09-20, 07:08 PM
(آخر تعديل لهذه المشاركة : 22-09-20, 07:10 PM {2} بواسطة moh developer.)
السلام عليكم
ممكن حل مشكلة الخطا دائما يظهر لي خطا لم يتم حفظ البيانات
Dim con As New SqlConnection("Server= \SQLEXPRESS; Database = mail; Integrated Security = true")
Dim da As New SqlDataAdapter
Dim dt As New DataTable
Dim cmd As New SqlCommand
Dim cmdb As SqlCommandBuilder
Try
Dim r As DataRow = dt.NewRow
r(1) = TextBox1.Text
r(2) = TextBox2.Text
r(3) = TextBox3.Text
r(4) = TextBox4.Text
r(5) = TextBox5.Text
r(6) = TextBox6.Text
r(7) = TextBox7.Text
dt.Rows.Add®
cmdb = New SqlCommandBuilder(da)
da.Update( dt )
MsgBox(" تم الادخال بنجاح", MsgBoxStyle.Information)
Catch ex As Exception
MsgBox(" لم يتم الادخال بنجاح", MsgBoxStyle.Information)
End Try