14-08-15, 04:02 AM
سلام
جرب باستخدم attachdbfilname لكن لابد من وضع مسار ملف قاعدت البيانات كامل وهنا مكانها مع ملف التشغيل applicatin.startupath
وايضا تاكد من AHMED-PC يمكن الاسم مختلف
جرب هذا اولا
الكود مجرب
او جرب هذا
موفقين
جرب باستخدم attachdbfilname لكن لابد من وضع مسار ملف قاعدت البيانات كامل وهنا مكانها مع ملف التشغيل applicatin.startupath
وايضا تاكد من AHMED-PC يمكن الاسم مختلف
جرب هذا اولا
كود :
Public con As New SqlConnection(New SqlConnectionStringBuilder() _
With {.DataSource = "AHMED-PC", _
.AttachDBFilename = Application.StartupPath + "\GoldData.mdf", _
.IntegratedSecurity = True, _
.UserInstance = True} _
.ConnectionString)او جرب هذا
كود :
Public con As New SqlConnection(New SqlConnectionStringBuilder() _
With {.DataSource = "AHMED-PC", _
.AttachDBFilename = Application.StartupPath + "\GoldData.mdf", _
.IntegratedSecurity = True, _
.UserID = "gold", _
.Password = "12345", _
.UserInstance = True} _
.ConnectionString)موفقين
متغيب
