请大家帮忙一下啊
String Strsql = "select * from usern where uname='" + TextBox1.Text+ "'";
OleDbCommand cmd_check = new OleDbCommand(Strsql, Conn);
DataSet ds= new DataSet();
if (ds["uname"] == null)//这里错(Cannot apply indexing with [] to an expression of type 'System.Data.DataSet')
{
SQL = "Insert into usern (uname,passw,email,love,sex) Values ('" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text+ "',+'" + TextBox4.Text + "','" + Dlv + "')";
OleDbCommand Cmd = new OleDbCommand(SQL, Conn);
Cmd.ExecutNonQuery();
Response.Redirect("done.aspx?id=4");
}
else
{
Response.Redirect("done.aspx?id=5");
}
[此贴子已经被作者于2004-10-13 18:23:05编辑过]