-
Getting error - Login failed on server side
Question asked by visitor papin
When i connect the database (on SQL server) by through of SQL Data Adapter and data set and finally fill the data set .. and run the programme ...in this time the error occurs - login failed on server side ...How it rectify please replay me..
-
Banned
Gratitude Forum!
Nor can Mehtap! I want to say that your site better throughout the World Wide Web
Thank you. Keep it.
-
Junior Member
Re: Getting error - Login failed on server side
Dear Friends,
You may user different connection string,
I thing you have to use DNS
Thanks,
Adarsh Patel
-
Junior Member
Re: Getting error - Login failed on server side
Hai,
Try the below coding for login .This is one sample.Here I tried when the “user name and password” in the login form and database is same then your “first name” which is in the database will display in one label(here you can display user login page).
protected void Button1_Click(object sender, EventArgs e)
{
string nname, npassword;
nname = txtname.Text.ToString();
npassword = txtpass.Text.ToString();
//make a SQL connection
SqlConnection con = new SqlConnection("your connection String")
con.Open();
SqlCommand cmd = new SqlCommand("SELECT FirstName FROM login WHERE (Username='" + nname + "' AND password='" + npassword + "')", con);
DataTable dt = new DataTable();
SqlDataAdapter adptr = new SqlDataAdapter(cmd);
adptr.Fill(dt);
if (dt.Rows.Count > 0)
{
DataRow dr1 = dt.Rows[0];
Label1.Text = "Welcome";
Label2.Text = dr1["FirstName"].ToString();
}
else
Label2.Text = "Sorry,Invalid User name or password.........please try again";
con.Close();
Regards,
Nithya.R
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules