[b]文章分类:.net编程[/b]
啥也不说了,刚刚研究出来滴~~~贴码:
啥也不说了,刚刚研究出来滴~~~贴码:
/// <summary>插入
/// 返回刚刚插入的ID
/// </summary>
/// <param name="groupname"></param>
/// <param name="gid"></param>
/// <returns></returns>
public bool Insert(string groupname, out string gid)
{
string sql = "insert into groupca(groupname) values(@groupname);select last_insert_rowid();";
helper.CreateCommand(sql);
helper.AddParameter("@groupname", groupname as object);
string res = helper.ExecuteScalar();
if (!string.IsNullOrEmpty(res))
{
gid = res;
return true;
}
else
{
gid = "0";
return false;
}
}