hi experts..
I need to execute a script in sql server using c#.i have used this code
string sqlConnectionString = @"Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=FinAccounts;Data Source=computer3\\SQLEXPRESS";
FileInfo file = new FileInfo(@"E:\SQLQuery3.sql");
string script = file.OpenText().ReadToEnd();
MessageBox.Show(script.ToString());
SqlConnection conn = new SqlConnection(sqlConnectionString);
Server server = new Server(new ServerConnection(conn));
server.ConnectionContext.ExecuteNonQuery(script);
file.OpenText().Close();
but an error "Failed to connect to the server" appears...what is the problem.
what should i change in the code?..please replay...
Loading
Manikavelu VelayuthamPosted Oct 12, 2010, 6:09 AM
http://codeeleven.blogspot.com/2007/12/setting-up-sqlexpress-database-for-use.html
Resmy RaviPosted Oct 12, 2010, 5:48 AM
but how can i sove that problem? please replay
Manikavelu VelayuthamPosted Oct 12, 2010, 5:35 AM