انا عملت هذا الكود لاضافة موظف جديد لكن يطلعلي error
' ExecuteReader: CommandText property has not been initialized
ما اعرف له حل
Private Sub NewStaff_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewStaff.Click
_oCon.ConnectionString = "server=(local);database=project;trusted_connection=yes"
str = "select * from Staff"
_adpt.Fill(DS, "Staff") ' ExecuteReader: CommandText property has not been initialized
t = DS.Tables(0)
cr = t.Rows.Count
For c = 0 To cr
If DS.Tables(0).Rows©.Item(0) Is ٍStaffID.Text Then
MessageBox.Show("THis staff ID is Exist,Please Enter a new one", "Errore Massege", MessageBoxButtons.OK, MessageBoxIcon.Error)
StaffID.Clear()
End If
Next
r = t.NewRow
r("Saf_id") = StaffID.Text
r("first") = Iname.Text
r("office_no") = OfficeNo.Text
r("office_phone") = OfficePhone.Text
r("email") = Email.Text
r("job_title") = jobTitle.Text
r("mobile") = Mobile.Text
r("phone") = Phone.Text
t.Rows.Add®
_adpt.Update(DS, "Staff")
MessageBox.Show("added successfully")
End Sub
[code]
ارجو المساعده :( :( :( :(

