0

good day guys! anyone can help me about this.. i need to create a login form with database (users.mdf) im newbie in c# .net i manage to create a connection my problem is the code behind the Login_Button

thanks God bless

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by ellorinco
0

Make two text boxes(for name and password) and one button on the login form. set password character of the password text box passwordBox.PasswordCharachter="*"; then connect you form with database using following code

connection = new SqlConnection("Data Source=Server_name;Initial Catalog=DB_name;Integrated Security=true");
connection.Open();
SqlCommand Command = connection.CreateCommand();
Command.Parameters.Clear();                
Command.Connection = connection;
Command.CommandText = "Select user_id, Password from Table_name";
Command.CommandType = CommandType.Text;
SqlDataAdapter Adapter = new SqlDataAdapter(Command);
Adapter.Fill(dataSet1, Table_name);
//button click event
//Code to check your user_id and password from the dataset1
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.