1 #region 注册
2 public void Registering()
3 { string SQLStr2 = String.Format("INSERT INTO UserTab(UserName,PassWord,UserAge,UserSex,NickName,RealName,UserStar,UserBlood,UserId) VALUES('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}')",
4 userinfo.UserName, userinfo.PassWord, userinfo.UserAge, userinfo.UserSex, userinfo.NickName, userinfo.RealName, userinfo.UserStar, userinfo.UserBlood, userinfo.UserId);
5 try
6 {
7 ClassSqlData SqlData = new ClassSqlData();
8 int num=SqlData.ExSQLNonQuery(SQLStr2);
9 if (num > 0)
10 {
11 MessageBox.Show("用户注册信息添加到数据库");
12 }
13 else
14 {
15 MessageBox.Show(注册信息失败);
16 }
17 }
18 catch (Exception e)
19 {
20 MessageBox.Show("异常处理:\n"+e.ToString());
21
22 }
23 finally { }
请发表评论