PDA

View Full Version : مشکل در وصل شدن به دیتا بیس



aminbrleevb
چهارشنبه 11 تیر 1393, 10:08 صبح
با سلام
من از sql server express R2 2008 استفاده می کنم .
یک برنامه دارم که وقتی اجراش میکنم خطا میده نمیدونم دیگه باید چی کارش کنم 1 هفتس که میگردم ولی بی فایدس
اینجا هم مطرح کردم و پیشرفت هایی هم کردم ولی بازم به نتیجه نرسیدم.
از اول می گم
من از sql server express R2 2008 استفاده می کنم یعنی هیچ دیتابیسی رو نمی خوام اتچ کنم . حالا یک برنامه دارم که یک دیتابیس هم داره
کانکشن استرینگ من اینه


Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|\dbtest.mdf;Integrated Security=True;Connect Timeout=30;


حالا وقتی تو یکی از درایو هام اجراش میکنم این خطا رو میده


System.Data.SqlClient.SqlException: Unable to open the physical file "E:\Debug\dbtest.mdf". Operating system error 5: "5(failed to retrieve text for this error. Reason: 15105)".
An attempt to attach an auto-named database for file E:\Debug\dbtest.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.


و وقتی میزارمش رو دستکتاپ و اجراش میکنم این خطا رو میده



See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Data.SqlClient.SqlException: An attempt to attach an auto-named database for file C:\Users\POWER\Desktop\Debug\dbtest.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share


خواهش میکنم کمک کنید