عندي قاعدة بيانات
وهاذي صورة عنها
وعندي كلاس يتعامل مع الداتا وهذا هو الكود
Public Function Add_Employee(ByVal Employee_ID As Integer, ByVal Employee_Name_E As String, ByVal Employee_Name_A As String, ByVal Department As String, ByVal Resigned As String, ByVal Date_Of_Resignation As Date, ByVal photo As System.Drawing.Image, ByVal Birth_Day As Date, ByVal Jobtitle As String, ByVal Date_Of_Appointment As Date, ByVal Nationality As String, ByVal Bank As String, ByVal Bank_Account_Number As Integer, ByVal Bank_Branch As String, ByVal Mobile As Integer) As String
Dim Image As New IO.MemoryStream()
photo.Save(Image, System.Drawing.Imaging.ImageFormat.Jpeg)
conn.ConnectionString = con
da.Fill(ds)
r = ds.Tables(0).NewRow
r(0) = Employee_ID
r(1) = Employee_Name_E
r(2) = Employee_Name_A
r(3) = Department
r(4) = Resigned
r(5) = Date_Of_Resignation
r(6) = Image.GetBuffer
r(7) = Birth_Day
r(8) = Jobtitle
r(9) = Date_Of_Appointment
r(10) = Nationality
r(11) = Bank
r(12) = Bank_Account_Number
r(13) = Bank_Branch
r(14) = Mobile
ds.Tables(0).Rows.Add®
Dim CB As New SqlCommandBuilder(da)
da.Update(ds.Tables(0))
End Functionوهذا زر الحدث الي يستدعي function
Dim t As New Employee_Class
t.Add_Employee(Me.TextBox1.Text, Me.TextBox2.Text, Me.TextBox3.Text, Me.TextBox4.Text, Me.TextBox5.Text, Me.TextBox6.Text, Me.PictureBox1.Image, Me.TextBox8.Text, Me.TextBox9.Text, Me.TextBox10.Text, Me.TextBox11.Text, Me.TextBox12.Text, Me.TextBox13.Text, Me.TextBox14.Text, Me.TextBox15.Text)يطلعلي خطاء غريب و هذة صورتة: