111,128
社区成员
发帖
与我相关
我的任务
分享string userName = Session['username1'] != null ? Session['username1'].ToString().Trim() : "";
if(String.IsNullOrEmpty(userName))
return;//如果userName不存在,没必要往下执行语句了
string str = TextBox1.Text.Trim();
string strsql = "insert into Wechat(StudentName,ClassID,word,username) select StudentName,ClssID,'"+str+"', '"+userName+"' from Student where username='"+userName +"'";
撸主先学习下基础吧
string userName = Session['username1'] != null ? Session['username1'].ToString().Trim() : "";
if(String.IsNullOrEmpty(userName))
return;//如果userName不存在,没必要往下执行语句了
string strsql = "insert into Wechat(StudentName,ClassID,word,username) select StudentName,ClssID,TextBox1.Text, '"+userName+"' from Student where username='"+userName +"'";
改成↑
ps:可能有错,手敲的代码