在对SQL表格进入添加操作时,添加完毕后,打开SQL 2005中的相应表格
发现,ID的排序并不是按照从0-399的顺序排列的。请问是怎么回事?怎样可以解决?
以下是代码
SqlCommand SqlCommand_delete = new SqlCommand();
SqlCommand_delete.Connection = con;
SqlCommand_delete.CommandText = command_delete;
SqlCommand_delete.ExecuteNonQuery(); for (int i = 0; i < 400; i++)
{
ID = i;
string command = "insert into TKdata values('"
+ ID + "','"
+ dataname + "','"
+ DataID + "','"
+ time + "','"
+ QWcode + "','"
+ QYcode + "','"
+ SDcode + "','"
+ QWvalue + "','"
+ QYvalue + "','"
+ SDvalue + "','"
+ Valid + "','"
+ Re + "')"; // string command = "delete from student where name='" + "艾未华" + "' and age='" + "999" + "'";
SqlCommand sqlCommand = new SqlCommand();
sqlCommand.Connection = con;
sqlCommand.CommandText = command;
sqlCommand.ExecuteNonQuery();
}
发现,ID的排序并不是按照从0-399的顺序排列的。请问是怎么回事?怎样可以解决?
以下是代码
SqlCommand SqlCommand_delete = new SqlCommand();
SqlCommand_delete.Connection = con;
SqlCommand_delete.CommandText = command_delete;
SqlCommand_delete.ExecuteNonQuery(); for (int i = 0; i < 400; i++)
{
ID = i;
string command = "insert into TKdata values('"
+ ID + "','"
+ dataname + "','"
+ DataID + "','"
+ time + "','"
+ QWcode + "','"
+ QYcode + "','"
+ SDcode + "','"
+ QWvalue + "','"
+ QYvalue + "','"
+ SDvalue + "','"
+ Valid + "','"
+ Re + "')"; // string command = "delete from student where name='" + "艾未华" + "' and age='" + "999" + "'";
SqlCommand sqlCommand = new SqlCommand();
sqlCommand.Connection = con;
sqlCommand.CommandText = command;
sqlCommand.ExecuteNonQuery();
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货