Click here to Skip to main content
16,004,761 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

This is vikash kumar i am freshing problem to creating login page by the help of Datatable.

Thanks and regard.
Posted
Comments
[no name] 16-Jun-13 8:23am    
And you problem/question is what exactly?
Rajesh Anuhya 21-Jun-13 2:45am    
Not clear

1 solution

SqlConnection cnn = new SqlConnection(Pass your Connection string);

SqldataAdapter da = new SqldataAdapter("Select * from users where username = '" +txtusername.text+ "' and password = '" +txtpwd.text+ "' ",cnn);

DataSet ds = new DataSet();
da.Fill(ds);

if(ds.Tables[0].Rows.Count !=0)
{
      Session["username"] = ds.Tables[0].Rows[0][2].ToString();
      Responce.Redirect("Default.aspx");
}

I hope its helping to you..........!!!!!
 
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