SqlCommand
(1)
Insertsql
(1)
Benson
(1)
Cmd
(1)

SqlCommand Parameterized query problems

Asked By benson.wong
14-Nov-09 09:43 PM
such as the following code :
...
string insertsql="INSERT INTO table (id,name) VALUES (@id,@name)";
SqlCommand cmd=new SqlCommand(insertsql,connection);
cmd.Parameters.Add(@id,1);
cmd.Parameters.Add(@name,"benson");

cmd.ExecuteNonQuery();


How do I get a real SQL?  cmd.CommandText get "INSERT INTO table (id,name)
VALUES (@id,@name)",
I hope to have   "INSERT INTO table (id,name) VALUES (1,'benson')"
Post Question To EggHeadCafe