主题:数据库有关
请问如何把一个整型的变量作为参数放在insert命令里,如下
int IDNumber;
dbCommand.CommandText = "insert clinicData" + "(ID, name, sex)" +
"values(" + "IDNumber," + "'nameTextBox.Text'," +"'SexComboBox.Text'"+ ")"
ID 是整型的,IDNumber 也是整型的 上面的写法编译出错,请问IDNumber的格式应该怎么写.
int IDNumber;
dbCommand.CommandText = "insert clinicData" + "(ID, name, sex)" +
"values(" + "IDNumber," + "'nameTextBox.Text'," +"'SexComboBox.Text'"+ ")"
ID 是整型的,IDNumber 也是整型的 上面的写法编译出错,请问IDNumber的格式应该怎么写.