日期:2014-05-17 浏览次数:21201 次
//InsertCommand
sql = @"insert into tPriceListItem(Name,ResourceName,Price,SubContractor,Admin,OrderId)
values(@Name,@ResourceName,@Price,@SubContractor,@Admin,@OrderId);";
SqlCommand insertCommand = new SqlCommand(sql, conn);
insertCommand.Parameters.Add("@Name", SqlDbType.VarChar, 500);
insertCommand.Parameters["@Name"].Value = name;
insertCommand.Parameters.Add("@ResourceName", SqlDbType.VarChar, 500, "ResourceName");
insertCommand.Parameters.Add("@Price", SqlDbType.Float, 500, "Price");
insertCommand.Parameters.Add("@SubContractor", SqlDbType.VarChar, 500, "SubContractor");
insertCommand.Parameters.Add("@Admin", SqlDbType.VarChar, 500, "Admin");
insertCommand.Parameters.Add("@OrderId", SqlDbType.BigInt, 500, "OrderId");
adapterItem.InsertCommand = insertCommand;