Results 1 to 3 of 3

Thread: system error?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    system error?

    at the executenonreader statement, i always get a system error. what am i doing wrong?


    Code:
                string SQLConnString = myConnection;
                SqlConnection myConn = new SqlConnection(SQLConnString);
                
                myConn.Open();
    
                SqlCommand myCommand = new SqlCommand("USE " + TxtDBName.Text + " " + storeProcString);
                SqlDataAdapter da1 = new SqlDataAdapter(myCommand);
                myCommand.Connection = myConn;
                myCommand.ExecuteNonQuery();
                myConn.Close();

  2. #2
    Frenzied Member dj4uk's Avatar
    Join Date
    Aug 2002
    Location
    Birmingham, UK Lobotomies: 3
    Posts
    1,131
    Try:
    Code:
    string SQLConnString = myConnection;
                SqlConnection myConn = new SqlConnection(SQLConnString);
    
                SqlCommand myCommand = new SqlCommand("USE " + TxtDBName.Text + " " + storeProcString, myConn);
                SqlDataAdapter da1 = new SqlDataAdapter(myCommand);
                myCommand.ExecuteNonQuery();
    DJ

  3. #3
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    If you put your code in a try...catch block, and catch the SqlExcpetion, you'll get better details of the exact problem.

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