【发布时间】:2014-11-12 17:58:19
【问题描述】:
我的代码有问题;当我运行我的程序时,它会产生以下错误:“输入字符串的格式不正确”。
这是我的代码:
public String generateID()
{
String newID = "";
String lastID =dataGridView1.Rows[dataGridView1.RowCount1].Cells[0].Value.ToString();
newID = lastID.Substring(1);
int temp = Int32.Parse(newID) + 1;
newID = "E" + temp.ToString("00");
return newID;
}
private void btnInsert_Click(object sender, EventArgs e)
{
textBox1.Text = generateID();
}
【问题讨论】:
标签: c# auto-generate