使用 GUID 值来作为数据库行标识 本帖最后由 shelly1214chen 于 2009-09-14 15:37:20 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在设计表的时候,可以,主键值的 “默认值或绑定”那行写 (newid()) , 新插入的记录的key ,就是 DUID 那样的一串字符。 GUID只在以前的一个购物网站上用过的! string strSqlInsert = "insert into [T_Area](Code,Name,AreaCode,GUID) values ('3333','嘉兴','嘻嘻','"+Guid.NewGuid()+"')"; //string strSqlInsert = "insert into [T_Area](Code,Name,AreaCode) values ('2222','嘉兴','嘻嘻')"; SqlCommand cmd=new SqlCommand(strSqlInsert,_sqlConnectionA); cmd.ExecuteNonQuery(); cmd = new SqlCommand(strSqlInsert, _sqlConnectionB); cmd.ExecuteNonQuery(); XmlTextReader用StreamReader初始化为空的问题 很有挑战性——脸部识别系统?期待高手给个思路! 想到到脑筋锈钭的treeview更新问题!! (求助)C#全局键盘钩子 从数据库中取得的项怎么获得没有重复的? 求助高手,窗口重绘问题 c# 窗体与窗体实时传值 怎么让窗体上的自定义控件在一进入窗体就获得焦点? 如何将InerBase的数据库转化为SQL Server 2000的数据库 .net和windows 困扰于NHibernate的三层架构 求教
//string strSqlInsert = "insert into [T_Area](Code,Name,AreaCode) values ('2222','嘉兴','嘻嘻')";
SqlCommand cmd=new SqlCommand(strSqlInsert,_sqlConnectionA);
cmd.ExecuteNonQuery();
cmd = new SqlCommand(strSqlInsert, _sqlConnectionB);
cmd.ExecuteNonQuery();