Monday, March 26, 2012

the connection string property has not been initialized

in one of my classes i have a private function, which sets connection
other public shared functions call this connection
when i try to call the public shared functions say to my form code i get that error
any one ever had that beforemake sure that the SQLCommand object's connection property is set to the SQLConnection object:

string connString = "blah"; //insert REAL conn string here
SQLConnection theConnection = new SQLConnection(connString);
SQLCommand theSQLCommand = new SQLCommand();
theSQLCommand.Connection = theConnection; //This line
..
..

0 comments:

Post a Comment