111,126
社区成员
发帖
与我相关
我的任务
分享
string sname = nametb.Text;
string spwd = pwdtb.Text;
if (conn.State == ConnectionState.Closed) { conn.Open(); }
SqlCommand sele = new SqlCommand("", conn);
sele.CommandText = "select 权限 from 管理员表 where 帐号='"+sname+"' and 密码='"+spwd+"'";
int i = sele.ExecuteNonQuery();
textBox1.Text = i.ToString();
SqlCommand cjietab = new SqlCommand("", conn);
cjietab.CommandText = "insert into 结帐表 "+"values"+"(tbdanhao.Text ,tbtaihao .Text ,tbprice .Text ,stime,cbpeople .Text )";
cjietab.ExecuteNonQuery();
cjietab.CommandText = "insert into 结帐表 "+"values"+"('"+tbdanhao.Text+"' ,'"+tbtaihao .Text+"' ,'"+tbprice .Text+"' ,"+stime+",'"+cbpeople .Text+"' )";