PDA

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



rezarko
شنبه 02 دی 1391, 14:53 عصر
سلام. من برای اتچ کردن دیتابیس از کد زیر استفاده میکنم ولی ارور میده
کد:


SqlConnection cnn = new SqlConnection("Data Source=.;Initial Catalog=master;Integrated Security=True");
try
{
cnn.Open();
string str = "use master;" +
"EXECUTE sp_attach_db @dbname = N'FastFood' , " +
" @filename1 = N'" + Application.StartupPath + "\\FastFood.mdf'," +
"@filename2 = N'" + Application.StartupPath + "\\FastFood_log.ldf'";

SqlCommand cmd = new SqlCommand(str, cnn);
cmd.ExecuteNonQuery();

ارور:
97091

rezarko
شنبه 02 دی 1391, 23:03 عصر
:ناراحت::افسرده::عصبانی++::گر ه: