how to immerse variable into SQL statement
Hi,
I have the SQL statement and don't know hot to immerse a variable into it. Can someone help please? Example: SqlCommand cmd = new SqlCommand("insert into Vydaje values ('variable', '2008-05-19', 150, 9788071698609)", conn); And I need to insert the variable exp[0] instead the word variable in the statement.
Thanks.
Regards, Petr.
Petr PuncocharPosted May 19, 2008, 5:01 PM
Ryan AlfordPosted May 19, 2008, 4:46 PM
SqlCommand cmd = new SqlCommand("insert into Vydaje values ('" + exp[0].ToString() + "', '2008-05-19', 150, 9788071698609)", conn);
Petr PuncocharPosted May 19, 2008, 4:01 PM
Ryan AlfordPosted May 19, 2008, 2:52 PM