TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Subin Thomas
NA
4.9k
117.3k
error in login code
Feb 18 2019 4:44 AM
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"
;
}
Reply
Answers (
16
)
what is the use of Script manager ?
Dropdown Value Show in Label Inside Gridview