PDA

Click to See Complete Forum and Search --> : the connection string property has not been initialized


d2005
Sep 8th, 2005, 07:49 AM
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 before

Techno
Sep 8th, 2005, 08:59 AM
make 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
..
..