在 System.Data.SqlClient.SqlException 中第一次偶然出现的“System.Data.dll”类型的异常 5
protectedvoidButton3_Click(objectsender,EventArgse){Response.Redirect("Manager/Manage...
protected void Button3_Click(object sender, EventArgs e)
{
Response.Redirect("Manager/ManagerIndex.aspx");
}
protected void Button1_Click(object sender, EventArgs e)
{
string userid = TextBox1.Text.Trim();
string username = TextBox2.Text.Trim();
string password = TextBox3.Text.Trim();
string beizhu = TextBox4.Text.Trim();
string quanxian = TextBox5.Text.Trim();
string college = DropDownList2.SelectedItem.Value;
string stuclass = DropDownList3.SelectedItem.Value;
string name = FileUpload1.FileName;
string serverPath = Server.MapPath("~/");
string paths = serverPath+"Photo\\" + name;
FileUpload1.SaveAs(paths);
select sl = new select();
if (sl.jianchaxuesheng(userid)==true)
{
Insert insert = new Insert();
if (insert.InsertStudent(userid, username, password, college, stuclass, paths, beizhu, quanxian))
Response.Write("<script>alert('提交成功!')</script>");
else
Response.Write("<script>alert('提交失败!')</script>");
Image1.ImageUrl = "~\\Photo\\" + name;
} 展开
{
Response.Redirect("Manager/ManagerIndex.aspx");
}
protected void Button1_Click(object sender, EventArgs e)
{
string userid = TextBox1.Text.Trim();
string username = TextBox2.Text.Trim();
string password = TextBox3.Text.Trim();
string beizhu = TextBox4.Text.Trim();
string quanxian = TextBox5.Text.Trim();
string college = DropDownList2.SelectedItem.Value;
string stuclass = DropDownList3.SelectedItem.Value;
string name = FileUpload1.FileName;
string serverPath = Server.MapPath("~/");
string paths = serverPath+"Photo\\" + name;
FileUpload1.SaveAs(paths);
select sl = new select();
if (sl.jianchaxuesheng(userid)==true)
{
Insert insert = new Insert();
if (insert.InsertStudent(userid, username, password, college, stuclass, paths, beizhu, quanxian))
Response.Write("<script>alert('提交成功!')</script>");
else
Response.Write("<script>alert('提交失败!')</script>");
Image1.ImageUrl = "~\\Photo\\" + name;
} 展开
2个回答
展开全部
st1 构造有错误,右侧少了一个单引号,like后面加个空格
st1=L"select * from KC where km like '"+textBox1->Text+"%'"
改成上面的试试
st1=L"select * from KC where km like '"+textBox1->Text+"%'"
改成上面的试试
追问
详细点吧 我的这个代码怎么改
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询