Click here to Skip to main content
15,921,210 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
public partial class forgotpwd : System.Web.UI.Page
{
    ADO objado = new ADO();
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        DataSet ds = objado.getpwd();
        if (TextBox1.Text == ds.Tables[0].Rows[0]["email"].ToString())
        {
            Label1.Text = ds.Tables[0].Rows[0]["password"].ToString();
        }


    }
}
Posted
Updated 29-Dec-13 22:36pm
v2
Comments
Karthik_Mahalingam 30-Dec-13 4:42am    
yes.. The syntax does that only..
what is your issue..
Please add more info...
sudhakarit 30-Dec-13 5:15am    
got output thanxx....
Karthik_Mahalingam 30-Dec-13 5:17am    
ok :)

1 solution

First count the number of rows present in the table ds.Tables[0].Rows.Count

And then use loop
C#
for(int i=0;i<ds.tables[0].rows.count;i++)>
{
if (TextBox1.Text == ds.Tables[0].Rows[i]["email"].ToString())
        {
            Label1.Text = ds.Tables[0].Rows[i]["password"].ToString();
        }
}
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900