vb.net - Can you pass more than 1 parameter in a single SQL statement through a VB command? -


Just wondering if you can have 2 parameters (@ Innssertepranameth) 1 SQL commands via VB? I have some code (sample code) below and I'm just thinking this is possible.

  command = new SqlCommand ( "Update boards set CDF_Supplier_Tx = '' + SupplierNameTxt.Text + '' Where CDF_Supplier_tx Select Supplier IN (where supplier Supplier = '' + SupplierNameTxt.Text + " ')", connection)  

this is where it says ' '+ SupplierNameTxt.Text +' ' it may @Insertnameparaname ?

If it is not clear as to which I will try to explain that it will end up with a little more then 2x @ instead of my code long supplierNameTxt.Text?

This is just a question, thanks in advance.

MyCommand = new SqlCommand ( "Update SeansMessage set Message1 = @ TicBoxText1, message2 = @ TicBoxText2 Where the number = 1 ", dbConn) MyCommand.Parameters.AddWithValue (" @ TicBoxText1 ", TicBoxText1.Text) MyCommand.Parameters.AddWithValue (" @ TicBoxText2 ", TicBoxText2. Text)

See:

You can also use the same parameters multiple times in your SQL text.


Comments