Click here to Skip to main content
15,885,537 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
string sqlstr = "select * from dbo.Login where username= ' " + Email + " ' and password= ' " + Password + " ' ";
               //adapter logic
               SqlDataAdapter adp = new SqlDataAdapter(sqlstr, con);
               DataSet ds = new DataSet();
               adp.Fill(ds);
               //datatable logic
               DataTable dt;
               dt = ds.Tables[0];
               return (dt);


What I have tried:

i tried but unable to get data
Posted
Updated 30-Nov-16 22:48pm
v2
Comments
StM0n 1-Dec-16 0:59am    
Sorry, but what does not work? Is there an error message? an exception?

Help us to help you.

BTW: there's a slight mismatch between your title and your "question"... that's not a 3 tier architecture problem, just a sql-statement. And your code looks like it could be vulnerable for sql-injection.

1 solution

 
Share this answer
 
Comments
F. Xaver 1-Dec-16 6:27am    
I like such tutorials ... its vulnerable for sql-injection

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