protected void Button1_Click(object sender, EventArgs e)
{
string ConnectionString = "Data Source=data1;user=system;password=manager;";
OracleConnection conn = new OracleConnection(ConnectionString);
try
{
conn.Open();
OracleCommand cmd = conn.CreateCommand();
cmd.CommandText = "select * from yonghu";
cmd.Parameters.Add("@name", OracleType.VarChar, 20);
OracleDataReader odr = cmd.ExecuteReader();
while (odr.Read())
{
Response.Write(odr.GetOracleString(1).ToString());
}
odr.Close();
}
catch (Exception ee)
{
Response.Write(ee.Message);
}
finally
{
conn.Close();
}
Response.Redirect("index.aspx");
}
数据库已经连上了,我想在yonghu这个表中取出用户名和密码并且和textbox1和textbox2中的数据比较,如果一样则
进入到下一个界面index.aspx,请高手帮忙,给出代码,谢谢!