Cmd.CommandText = "select * from table1 where field1= 20 /pre> <pre>Cmd.CommandText = "select * from table1 where field1= '" & TextBox1.Text & "'"
Cmd.CommandText = "select * from table1 where field1= " & TextBox1.Text
select * from Table1 where Filed1= '" & TextBox1. Text & "'"
using (SqlCommand Cmd = ...) { Cmd.CommandText = "SELECT * FROM Table1 WHERE Field1 = @value"; Cmd.Parameters.Add("@value", SqlDbType.NVarChar).Value = TextBox1.Text; // Then execute the command. }
Cmd.CommandText = "select * from Masterbatch where MBColor = "& Val(ComboBox9.SelectedItem) &""
42'; DELETE FROM Masterbatch; --
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)