Click here to Skip to main content
15,073,503 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Greetings for the day,
I am beginner of i am not getting this code kindly help me it is basically logincode..

if (ds.Tables["tbl_login"].Rows.Count == 1 && ds.Tables["tbl_login"].Rows[0][0].ToString() == "1")
            Label17.Text = "Username is not Available.";
            Label17.BackColor = System.Drawing.Color.Red;
            Label17.Text = "Username is Available.";
            Label17.BackColor = System.Drawing.Color.Green;

kindly help me..
Code For You 1-Apr-15 2:05am
please give us more details on the question.

1 solution

All it does is check if the returned data consists of a single row, and that the first cell of that row contain a specific value.
If it does, the username exists, if it doesn't it doesn't.

It's not login code, it's registration code most likely - and exactly how it works will depend on the query which filled the DataSet and DataTable(s).
Member 10874581 1-Apr-15 2:56am
than in first block we should say user name exist ...because we are getting data
OriginalGriff 1-Apr-15 3:07am
Not necessarily. As I said, "exactly how it works will depend on the query which filled the DataSet and DataTable(s)".

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

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