I get this error message:
A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)
This occurs when I try to open connection. Here is code:
note: There is no database created yet in this server.Code:string conStr = "Server=www.freesqlserver.com;Database=mytable;UID=john1;PWD=pass1;";//not actual user-pass System.Data.SqlClient.SqlConnection con = new System.Data.SqlClient.SqlConnection(conStr); System.Data.SqlClient.SqlCommand cmd; cmd = new System.Data.SqlClient.SqlCommand("Select * from mytable", con); con.Open(); cmd.ExecuteNonQuery(); con.Close();




Reply With Quote