假设a的值是'1’ 数据库中有1,2,3,4,5 。 这个发放我在调用的时候只能返回2有什么办法能返回6
public string getin_id(string a)
{
if (MyDataClass.getDataSet("select in_id from ink where in_id = '" + a + "' ", "wz").Tables[0].Rows.Count > 0)
{
a = (Convert.ToInt64(a) + 1).ToString();
getin_id(a);
}
else
{
return a;
}
return a;
}
------解决思路----------------------
static int getin_id(int a)
{
if(a<6)
{
return getin_id(++a);
}
else
{
return a;
}
}