我想知道我哪错了我不知道怎么改谢谢了
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/09/20 09:42:54
我想知道我哪错了我不知道怎么改谢谢了
public partial class chat_login :System.Web.UI.Page
{
private System.Data.OleDb.OleDbCommand objselectcomm;
private System.Data.OleDb.OleDbConnection objchatconn;
protected void Page_Load(object sender,EventArgs e)
{
}
protected void btn2_Click(object sender,EventArgs e)
{
this.txtname.Text = "";
this.ckbox.Checked = false;
}
protected void ImageButton1_Click(object sender,ImageClickEventArgs e)
{
SqlConnection con=new SqlConnection();
SqlCommand com=new SqlCommand();
string myread="dataread from yonghu3 where name='"+this.txtname.Text+"',pass='"+this.txtpwd.Text+"'";
try
{
if(txtname!=null&&txtpwd!=null)
{
if("dataread from yonghu3 where name='"+this.txtname.Text+"',pass='"+this.txtpwd.Text+"'")
{
con.ConnectionString="server=.;integrated security=sspi;database=yonghu";
com.Connection= con;
com.CommandText=myread;
com.Connection.Open();
com.ExecuteReader();
Response.Redirect("jiyilt1.aspx");
}
else
Label1.Text="用户名或密码不正确";
}
else
Label1.Text="请输入用户名和密码";
}
catch(System.Exception msg)
{
Response.Write(msg.Message.ToString());
}
finally
{
com.Connection.Close();
}
}
protected void ImageButton2_Click(object sender,ImageClickEventArgs e)
{
Response.Redirect("zhuce.aspx");
}
}
编译错误
说明:在编译向该请求提供服务所需资源的过程中出现错误.请检查下列特定错误详细信息并适当地修改源代码.
编译器错误消息:CS0029:无法将类型“string”隐式转换为“bool”
行 41:if("dataread from yonghu3 where name='"+this.txtname.Text+"',pass='"+this.txtpwd.Text+"'")
public partial class chat_login :System.Web.UI.Page
{
private System.Data.OleDb.OleDbCommand objselectcomm;
private System.Data.OleDb.OleDbConnection objchatconn;
protected void Page_Load(object sender,EventArgs e)
{
}
protected void btn2_Click(object sender,EventArgs e)
{
this.txtname.Text = "";
this.ckbox.Checked = false;
}
protected void ImageButton1_Click(object sender,ImageClickEventArgs e)
{
SqlConnection con=new SqlConnection();
SqlCommand com=new SqlCommand();
string myread="dataread from yonghu3 where name='"+this.txtname.Text+"',pass='"+this.txtpwd.Text+"'";
try
{
if(txtname!=null&&txtpwd!=null)
{
if("dataread from yonghu3 where name='"+this.txtname.Text+"',pass='"+this.txtpwd.Text+"'")
{
con.ConnectionString="server=.;integrated security=sspi;database=yonghu";
com.Connection= con;
com.CommandText=myread;
com.Connection.Open();
com.ExecuteReader();
Response.Redirect("jiyilt1.aspx");
}
else
Label1.Text="用户名或密码不正确";
}
else
Label1.Text="请输入用户名和密码";
}
catch(System.Exception msg)
{
Response.Write(msg.Message.ToString());
}
finally
{
com.Connection.Close();
}
}
protected void ImageButton2_Click(object sender,ImageClickEventArgs e)
{
Response.Redirect("zhuce.aspx");
}
}
编译错误
说明:在编译向该请求提供服务所需资源的过程中出现错误.请检查下列特定错误详细信息并适当地修改源代码.
编译器错误消息:CS0029:无法将类型“string”隐式转换为“bool”
行 41:if("dataread from yonghu3 where name='"+this.txtname.Text+"',pass='"+this.txtpwd.Text+"'")
if("dataread from yonghu3 where name='"+this.txtname.Text+"',pass='"+this.txtpwd.Text+"'")
你这个东西是string类型,而if里面需要 bool型的,当然报错啦.
你这个东西是string类型,而if里面需要 bool型的,当然报错啦.
我想知道我哪错了我不知道怎么改谢谢了
C语言程序题 我想知道我错哪 了- -怎么改.
”我知道错了,心情很繁重”怎么改通顺?
我不知道按错了,这个文件最初的情况下.我不知道该怎么变成这个样子的错误,怎么改回原来的
手机给我设置成英文了,不知道怎么改回去.
这道题是高数题.我不知道怎么做.教教我吧〜谢谢了
不知道手机怎么变成英文了,怎么改回来?\x09谢谢了,大神帮忙啊
我不知道怎么说了
知道这样不对,可我就是不知道怎么改
我不知道你在那可是我想你了英文怎么翻译
我写的这首诗下面不知道该怎么写了,帮我想几句
怎么学好英语语法这些.知道怎么用,但是做题老错.不知道怎么学了.我今年高1.我想还有机会,帮我下啊一做题就不会了.平时还