i have written a login code which was sucessfuly working noe i have changes i need to take the uid and password from different table of same databse i changed the query where the table name i have changed and the field name but it is not working why
- string strSelect = "SELECT COUNT(*) FROM [database name].[dbo].[tablename] WHERE ReserveUID = @Username AND LoginPassword = @Password";
- SqlConnection con = new SqlConnection(con_Vas);
- SqlCommand cmd = new SqlCommand();
- cmd.Connection = con;
- cmd.CommandType = CommandType.Text;
- cmd.CommandText = strSelect;
- SqlParameter username = new SqlParameter("@Username", SqlDbType.NVarChar, 50);
- username.Value = txtusername.Text.Trim().ToString();
- cmd.Parameters.Add(username);
- SqlParameter password = new SqlParameter("@Password", SqlDbType.NVarChar, 100);
- password.Value = Encrypt(txtpassword.Text.Trim());
- cmd.Parameters.Add(password);
- con.Open();
- int result = (Int32)cmd.ExecuteScalar();
- con.Close();
- if (result >= 1)
- {
- Response.Redirect("ProjectDashboard.aspx");
- }
- else
- {
- txtusername.Text = "";
- txtpassword.Text = "";
- Label1.Text = "invalid credential";
- }

Subin ThomasPosted Feb 19, 2019, 12:42 AM
Salman BegPosted Feb 19, 2019, 12:37 AM
Subin ThomasPosted Feb 19, 2019, 12:31 AM
Salman BegPosted Feb 19, 2019, 12:10 AM
Subin ThomasPosted Feb 18, 2019, 11:58 PM
Salman BegPosted Feb 18, 2019, 11:55 PM
Subin ThomasPosted Feb 18, 2019, 11:41 PM
Salman BegPosted Feb 18, 2019, 11:36 PM
Subin ThomasPosted Feb 18, 2019, 11:32 PM
Salman BegPosted Feb 18, 2019, 11:08 PM
Subin ThomasPosted Feb 18, 2019, 10:56 PM
Subin ThomasPosted Feb 18, 2019, 10:55 PM
Salman BegPosted Feb 18, 2019, 9:08 AM
Piyush PansuriyaPosted Feb 18, 2019, 6:15 AM
Subin ThomasPosted Feb 18, 2019, 5:10 AM
Puneet KankarPosted Feb 18, 2019, 4:56 AM