Using variable in an insert statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following insert statement:

"INSERT INTO Queue(CustomerId, Status, QueueId, Type, January) VALUES
(@CustomerId" + ", @Status, @QueueId, @Type, @January); SELECT uId,
CustomerId, Status, QueueId, " + "Type, January FROM Queue WHERE (uId =
@@IDENTITY)";

this.sqlInsertCommand1.Parameters.Add("@January",
System.Data.SqlDbType.VarChar, 10, "January").Value =
ItemQueue.Items.ToString();

Where you see "January" I would like to pass a vaiable depending o the month
selected.

How can I accomplish this task?

Thanks, Justin.
 
Back
Top