The text of this article is not in this database — only its details are. Read it on the old site: Login Form With SQL In C#
19 Comments
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
The text of this article is not in this database — only its details are. Read it on the old site: Login Form With SQL In C#
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
Šăňi BābaPosted Jun 2, 2020, 11:30 PM
Plz help me out why it is?
Šăňi BābaPosted Jun 2, 2020, 11:30 PM
I am facing a problem with coding and shows problem in sda. Fill(dt); here
Šăňi BābaPosted Jun 2, 2020, 11:28 PM
Sir i need ur cell number plz my cell number is 03135436528
riann qistinaPosted Jan 8, 2019, 8:57 PM
How to select different table to show to the next new page. For example i have 2 table. First table name tblUser which have column name username and password and roleid and the second table is tblerole which have column name roleid and rolename. How i want to select rolename to display on the next page after sucessfully login?
Paramee EkanayakePosted Jul 31, 2018, 6:33 PM
Hmmmmm....u-iju huhdesew nuttytvsea deyaekman use.......
Cesar SalazarPosted Feb 1, 2018, 10:10 PM
Excelent Method, thanks!!
Krishna Rajput SinghPosted Mar 2, 2016, 5:38 AM
http://www.c-sharpcorner.com/UploadFile/a5f59f/how-to-create-log-in-form-in-visual-studio-and-connection-wi/
Evans KyeiPosted Feb 16, 2016, 10:28 PM
Nice, but Connection property has not been initialized. , you need to open and close the connection like this = private void button1_Click(object sender, EventArgs e) { SqlConnection conn=new SqlConnection (connString ); conn.Open(); SqlDataAdapter sda = new SqlDataAdapter("select count (*) from tblogin where uname='" + txtuname.Text + "' AND pass='" + txtpass.Text + "'", conn); DataTable dt = new DataTable(); sda.Fill(dt); if (dt.Rows[0][0].ToString() == "1") { this.Hide(); new frmMain ().Show(); //this.Dispose(); } else MessageBox.Show("Invalid username or password"); conn.Close(); } }
Santhakumar MunuswamyPosted Feb 12, 2016, 11:29 PM
Thanks for nice share
Waseem AfePosted Aug 22, 2015, 7:31 AM
Oh thank you very very much i am very glad after solving this problem
Jyotsna BetkarPosted Aug 11, 2015, 3:11 PM
thnx..this code useful to me...keep it on
ARJUN SINGH YADAVPosted Aug 7, 2015, 2:06 PM
follow us
Pramod LawatePosted Dec 22, 2014, 12:21 PM
keep it up.....
Ankit MishraPosted Dec 22, 2014, 5:04 AM
After Creating the connection you have not opened it and neither closed it.
Ehtesham MehmoodPosted Dec 21, 2014, 12:16 PM
Sure Mahesh Chand sir :)
Mahesh ChandPosted Dec 21, 2014, 9:08 AM
Yes as other comment says, use the "using" keyword for better object and resource management. Cheers!