PDA

View Full Version : سوال: connection string برای sql2005 در C#‎ 2010



hamed_hossani
یک شنبه 27 فروردین 1391, 01:49 صبح
سلام
من برای وصل شدن به پایگاه داده از کلاس (accessLayer) معماری چندلایه استفاده می کنم
برنامم رو با vs2010 نوشتم و دیتابیسم sql2005 است.
توی این سایت و سایت connectionString.com هر چی گشتم جواب نگرفتم.
شاید ارور مربوط بشه به یوزر ها ویا سطح دسترسی در sql ...
نمی دانم!



private string cs = @"Data Source=.\SQLEXPRESS;AttachDbFilename=" + Environment.CurrentDirectory +
@"\DB\databaseKomite.mdf;Integrated Security=true;";


متن ارور



Unable to open the physical file "E:\Project\project designing\komite\26.1.91\WindowsFormsApplication3\ WindowsFormsApplication3\bin\Debug\DB\databaseKomi te.mdf". Operating system error 5: "5(Access is denied.)".
An attempt to attach an auto-named database for file E:\Project\project designing\komite\26.1.91\WindowsFormsApplication3\ WindowsFormsApplication3\bin\Debug\DB\databaseKomi te.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

با تشکر

ASKaffash
یک شنبه 27 فروردین 1391, 07:37 صبح
سلام
برای اعمال تغییرات روی بانک (جداول / فیلدها / استورها /.... ) از خود SQL Server Management Studio استفاده می کنید یا از محیط Visual Studio ؟

hamed_hossani
یک شنبه 27 فروردین 1391, 11:16 صبح
من هم همین کار رو می کنم
می خوام با کانکشن استرین وصل بشم به پایگاه
و پایگاه داده تو پوشه های سایتم باشم!

hamed_hossani
دوشنبه 28 فروردین 1391, 18:55 عصر
کانکشن استرینگ تو پوشه های پروژه ام باشه!