C
Cem Louis
Hi,
Q1: How can I transfer an SQL database manually? I have a database
which is named mydb, I looked at the harddrive and found it on
"C:\Program Files\Microsoft SQL Server\MSSQL\Data" there is 2 file one
of them is mydb.mdf and the lof file of that. I copied these on
another machine on the same path but couldn't make it to work???
Q2: I used the below code to EMPTY a table which is named people but
it is not working???:
SqlConnection mySqlConnection4 = new SqlConnection("Initial
Catalog=mydb;Data Source=" + comboBox1.SelectedItem.ToString() +
";Integrated Security=SSPI;");
mySqlConnection4.Open();
SqlCommand mySqlCommand4 = mySqlConnection4.CreateCommand();
SqlTransaction myTrans;
myTrans = mySqlConnection4.BeginTransaction(IsolationLevel.ReadCommitted,"SampleTransaction");
mySqlCommand4.Connection = mySqlConnection4;
mySqlCommand4.Transaction = myTrans;
mySqlCommand4.CommandText = "EMPTY people" ;
//mySqlCommand4.ExecuteNonQuery();
myTrans.Commit();
mySqlConnection4.Close();
Anyway What is the problem???
Any help would be greatly appreciated...
Cem Louis
Q1: How can I transfer an SQL database manually? I have a database
which is named mydb, I looked at the harddrive and found it on
"C:\Program Files\Microsoft SQL Server\MSSQL\Data" there is 2 file one
of them is mydb.mdf and the lof file of that. I copied these on
another machine on the same path but couldn't make it to work???
Q2: I used the below code to EMPTY a table which is named people but
it is not working???:
SqlConnection mySqlConnection4 = new SqlConnection("Initial
Catalog=mydb;Data Source=" + comboBox1.SelectedItem.ToString() +
";Integrated Security=SSPI;");
mySqlConnection4.Open();
SqlCommand mySqlCommand4 = mySqlConnection4.CreateCommand();
SqlTransaction myTrans;
myTrans = mySqlConnection4.BeginTransaction(IsolationLevel.ReadCommitted,"SampleTransaction");
mySqlCommand4.Connection = mySqlConnection4;
mySqlCommand4.Transaction = myTrans;
mySqlCommand4.CommandText = "EMPTY people" ;
//mySqlCommand4.ExecuteNonQuery();
myTrans.Commit();
mySqlConnection4.Close();
Anyway What is the problem???
Any help would be greatly appreciated...
Cem Louis