Answered by:
Creating a Web User ID Password

Question
-
User115673193 posted
I want to create a web form which have a user id and password someone can tell me how its possible. pls write a example code.
without using of dataset and dataadaptor.
Friday, August 16, 2013 12:33 AM
Answers
-
User-574293449 posted
using (SqlConnection conn = new SqlConnection('your connection string')) using(SqlCommand cmd = new SqlCommand(sqlStatement, conn)) { conn.open(); using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { //read here } } }
IF the data present then you can return as authentication passed
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, August 16, 2013 5:11 AM
All replies
-
User-574293449 posted
hi,
Can you explain in detail what you need. If you need to check authentication without dataset / data adapter, you can use datareader / exceutescalar with status or set status in output varible.
Friday, August 16, 2013 12:42 AM -
User115673193 posted
i have a database in sqlserver express edition. which have a which have table admin with two field userid and password.
i want to check authentication with datareader. so pls give me some example code.
Friday, August 16, 2013 1:16 AM -
User-306750178 posted
Hi,
Refer below links
http://www.codeproject.com/Questions/339666/verify-user-name-and-password-in-csharp-form
Above links have example codes which will help you.
Friday, August 16, 2013 1:37 AM -
User-574293449 posted
using (SqlConnection conn = new SqlConnection('your connection string')) using(SqlCommand cmd = new SqlCommand(sqlStatement, conn)) { conn.open(); using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { //read here } } }
IF the data present then you can return as authentication passed
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, August 16, 2013 5:11 AM