Results 1 to 4 of 4

Thread: [RESOLVED] still can't connect to sql server

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,168

    Resolved [RESOLVED] still can't connect to sql server

    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:

    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();
    note: There is no database created yet in this server.
    Last edited by Hack; Feb 28th, 2007 at 12:19 PM. Reason: Added [RESOLVED] to thread title and green "resolved" checkmark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width