P
Pai
Hello there,
I have a .aspx page with the following code in the click event of a
button.
get the following error:
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'
Code:
string myConnectionString =
"server=testserver;database=MembersCustom;user
id=test;pwd=test;integrated security=true;";
SqlConnection myCon = new SqlConnection (myConnectionString);
string mySqlString = " select * from Cycle_Details";
SqlDataAdapter myCmd = new SqlDataAdapter (mySqlString,myCon);
DataSet my_dataset = new DataSet();
myCmd.Fill (my_dataset,"Cycle_Details");
foreach ( DataTable tb in my_dataset.Tables)
{
foreach ( DataRow rw in tb.Rows)
{
foreach( DataColumn cl in tb.Columns )
{
TextLastName.Text = rw[cl].ToString() ;
}
}
I have added the user test to the logins section under Security
options in the SQL Server and given db_datareader and db_datawriter
roles to the user.
I have also added ASPNET to the same section and given the same rights
for the MembersCustom database
But i still get the error.
This is how the Web.config file looks like:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation
defaultLanguage="c#"
debug="true"
/>
<customErrors
mode="RemoteOnly"
/>
<authentication mode="Windows" />
<authorization>
<allow users="*" /> <!-- Allow all users -->
</authorization>
<trace
enabled="false"
requestLimit="10"
pageOutput="false"
traceMode="SortByTime"
localOnly="true"
/>
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data
source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>
<globalization
requestEncoding="utf-8"
responseEncoding="utf-8"
/>
</system.web>
</configuration>
Any help or suggestions...
Kind Regards,
Pai.
I have a .aspx page with the following code in the click event of a
button.
get the following error:
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'
Code:
string myConnectionString =
"server=testserver;database=MembersCustom;user
id=test;pwd=test;integrated security=true;";
SqlConnection myCon = new SqlConnection (myConnectionString);
string mySqlString = " select * from Cycle_Details";
SqlDataAdapter myCmd = new SqlDataAdapter (mySqlString,myCon);
DataSet my_dataset = new DataSet();
myCmd.Fill (my_dataset,"Cycle_Details");
foreach ( DataTable tb in my_dataset.Tables)
{
foreach ( DataRow rw in tb.Rows)
{
foreach( DataColumn cl in tb.Columns )
{
TextLastName.Text = rw[cl].ToString() ;
}
}
I have added the user test to the logins section under Security
options in the SQL Server and given db_datareader and db_datawriter
roles to the user.
I have also added ASPNET to the same section and given the same rights
for the MembersCustom database
But i still get the error.
This is how the Web.config file looks like:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation
defaultLanguage="c#"
debug="true"
/>
<customErrors
mode="RemoteOnly"
/>
<authentication mode="Windows" />
<authorization>
<allow users="*" /> <!-- Allow all users -->
</authorization>
<trace
enabled="false"
requestLimit="10"
pageOutput="false"
traceMode="SortByTime"
localOnly="true"
/>
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data
source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>
<globalization
requestEncoding="utf-8"
responseEncoding="utf-8"
/>
</system.web>
</configuration>
Any help or suggestions...
Kind Regards,
Pai.