|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Newbie: Examples of ExecuteNonQueryDoes anyone have any examples of "ExecuteNonQuery"? I've tried to grap
this phrase but examples may be my only way of understanding this concept. Any real-world code snipits with a brief description would be so kind. Thanks! You would use that for something that was going to execute but not
return anything (like an Update, Insert, or Delete statement) Thanks, Mick I've cut out the error handling and input validation code so you can see the
idea clearly. Use when you do not need a return value (such as an Insert). Public Sub AddNewCustomer() Dim strSQLServer As New SqlConnection(strConn) Dim cmd As New SqlCommand("CustomerInsert", strSQLServer) cmd.CommandType = CommandType.StoredProcedure cmd.Connection = strSQLServer cmd.Parameters.Add(New SqlParameter("@Honorific", SqlDbType.VarChar, 10)) cmd.Parameters.Item(0).Value = txtSal.Text cmd.Parameters.Add(New SqlParameter("@FirstName", SqlDbType.VarChar, 50)) cmd.Parameters.Item(1).Value = txtFirstName.Text cmd.Parameters.Add(New SqlParameter("@LastName", SqlDbType.VarChar, 50)) cmd.Parameters.Item(2).Value = txtLastName.Text strSQLServer.Open() cmd.ExecuteNonQuery() strSQLServer.Close() End Sub Show quoteHide quote "Parasyke" <kress1963no***@yahoo.com> wrote in message news:1145642671.297157.82910@i40g2000cwc.googlegroups.com... > Does anyone have any examples of "ExecuteNonQuery"? I've tried to grap > this phrase but examples may be my only way of understanding this > concept. Any real-world code snipits with a brief description would be > so kind. > > Thanks! >
TableAdapters and true N-Tier
dotnet security exception issues Newbie Question about Value and Reference Types VB2005 structures to file Addhandler with parameter ? Can't read xml to Excel (dataset.WriteXml) Problem in datagrid How I generate a tone programatically without resorting to playing a file such as MP3, WAV, etc.? question on dataset NTIER Issue |
|||||||||||||||||||||||