日期:2014-05-18 浏览次数:20426 次
bool InsertOK; InsertOK = false; do { Num = rnd.Next(0, 100000); sql = "select id from TableName where Number='" + Num + "'"; if (读取不到此记录) { 执行("insert into TableName(Number) values('" + Num+"')"); InsertOK = true; } } while (!InsertOK);