none
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'. (Description: An unhandled exception occurred during the execution code) RRS feed

  • Question


  • Hi dear,

    Pls rectify the following error.

    I am using sqlserver2005 and .net2003 version.

    I create simple database connection in c#.net web application.
    my sql username:"training" and no enter the password.
    I connect the window authontication in sqlserver.

    Following code working in C#window application, But do not working in C#web application.

    ********************************************************************************************************
    Code
    ******
    SqlConnection con=new SqlConnection("server=speechserver;Integrated Security=SSPI;database=sreekandan");
                con.Open();
                           SqlCommand cmd=new SqlCommand("select * from amma",con);
                            SqlDataAdapter da=new SqlDataAdapter(cmd);                       
                DataSet ds=new DataSet();           
                da.Fill(ds);
                DataGrid1.DataSource=ds;
    *********************************************************************************************************************************
    error:
    *****
    System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
    ********************************
    Line 53:             //OleDbConnection con=new OleDbConnection("Provider= SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=sreekandan;Data Source=SPEECHSERVER");
    Line 54:             SqlConnection con=new SqlConnection("server=speechserver;Integrated Security=SSPI;database=sreekandan");
    Line 55:             con.Open();------------>(Error Here)
    Line 56:                        SqlCommand cmd=new SqlCommand("select * from amma",con);
    Line 57:                         SqlDataAdapter da=new SqlDataAdapter(cmd);
    *********************************************************************************************************************************************8
    Thanks Regards:
    S.S.Sivaprasad
    Thursday, October 11, 2007 7:47 AM

Answers