c#中ADO问题
private void 打开ToolStripMenuItem1_Click(object sender, EventArgs e){
string sql = "";
cmd = new SqlCommand();
if (ds.GetChanges() == null)
{
return;
}
foreach (DataRow row in ds.Tables[0].Rows)
{
switch (row.RowState)
{
case DataRowState.Added:
sql = "insert into stuInfo values('" + row[0]+ "','" + row[1] + "','" + row[2] + "')";
cmd.Connection = con;
con.Open();
cmd.CommandText = sql;
cmd.ExecuteNonQuery();
break;
}
}
怎么样才能让我的ID列获取用当前日期作为自己定义的数据,并且自增长.例如(200706040001下列就为200706040002) 我是在DataGriDView中添加数据的