10-10-18, 03:48 PM
(آخر تعديل لهذه المشاركة : 10-10-18, 04:05 PM {2} بواسطة asemshahen5.)
ادخل الى المديول "GlobalModule"و تأكد من معلومات نص الاتصال و ضع جملة :
كود :
Public Function opendb() As SqlConnection
'conn.ConnectionString = "Data Source=(LocalDB)\v11.0;AttachDbFilename=" + Application.StartupPath + "\dental.mdf"
Try
Dim conn As New SqlConnection("Data Source=(Local);Initial Catalog=dental;Integrated Security=True")
If conn.State = 1 Then conn.Close()
conn.Open()
cmd.Connection = conn
cmd.CommandType = CommandType.Text
Return conn
Catch ex As Exception
MsgBox(ex.Message)
Return Nothing
End Try
End Functionسبحان الله وبحمده سبحان الله العظيم و الحمد لله ولا اله الا الله والله اكبر
