|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, December 07, 2010 6:58 AM
Points: 115,
Visits: 17
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, June 28, 2007 10:55 AM
Points: 1,
Visits: 1
|
|
You might want to add that the syntax:
cmdMyCommand.Parameters("@LastName") = strLastName that works just fine under ADO doesn't seem to work under ADO.Net.
Sprocs don't seem to know anything about their parameters until execution. I guess it makes sense when one considers the basic idea behind ADO.Net is to do away with stateful database interactions.
This change was the cause of some consternation here, as disappearance of the the old syntax does not seem to be documented anywhere.
Brian Begy Chicago Data Solutions
Brian Begy Chicago Data Solutions
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, March 08, 2005 11:22 AM
Points: 2,
Visits: 1
|
|
I know this is just an example that you presented in the article. So I have a recommedation ( learnt over time). When you are working with connections to the database using the command object, I would sincerely recommend the following technique . The following practice will keep the connection pool in better control: Instead of myCommand.Open(); or myCommand.Close(); directly Use this while opening connections: if( myCommand.Connection.State == ConnectionState.Closed) myCommand.Open(); Use this while closing connections: if( myCommand.Connection.State == ConnectionState.Open) myCommand.Close();
|
|
|
|