|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
sqlcommand questionIn the sourcecode as following,
Dim cmd As New SqlCommand() With cmd .CommandText = "Delete from Authors where au_lname = 'Smith'" .Connection = cn .CommandType = CommandType.Text End With Please tell me what does ".CommandType = CommandType.Text " this do. Thanks. Hi,
> It can as well be the one for stored procedure> Please tell me what does ".CommandType = CommandType.Text " this do. > Thanks. (By default is it as you have so this one is not needed) I hope this helps, Cor it is used to inform the database that which kind of statment you are
firing into the DB. that helps DB to server more better. if you are firing DML Queries on the DB than it should be " CommandType.Text" just like you have done in your specified code. if you are invoking any stored procedure resides in DB than you can set the command type to "storedprocedure" that tellls the DB that u want to run a storedProcedure and it will serve you that way. |
|||||||||||||||||||||||