Results 1 to 4 of 4

Thread: Getting error - Login failed on server side

  1. #1
    Geek_Guest
    Guest

    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..


  2. #2
    Banned
    Join Date
    Apr 2007
    Answers
    2

    Post Gratitude Forum!

    Nor can Mehtap! I want to say that your site better throughout the World Wide Web
    Thank you. Keep it.


  3. #3
    Junior Member
    Join Date
    Jun 2007
    Answers
    4

    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


  4. #4
    Junior Member
    Join Date
    Feb 2009
    Answers
    21

    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
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact