Hello, I'm having big troubles when I setup an SqlConnection object to a remote SQL Server within an ASP.NET web application.
My Windows account is system administrator in the remote SQL Server. When I open the connection in the Server Explorer, it's all right. But look at this: when I create a ASP.NET web app and drop any table over the form designer, the SqlConnection object that was automatically generated by .NET seems to have troubles during login operation.
The error is given at runtime when I try to fill the dataset using the connection I talked about previously. The error page says:
Server Error in '/ProductsPerCategory' Application.
Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
[font=Arial, Helvetica, Geneva, SunSans-Regular, sans-serif]Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
Source Error:
Line 77: 'Put user code to initialize the page hereLine 78: If Not Me.IsPostBack ThenLine 79: DACategories.Fill(DsCategories1)Line 80: DropDownList1.DataBind()Line 81: End If
Source File: C:\Inetpub\wwwroot\ProductsPerCategory\DataGridForm.aspx.vb Line: 79
Stack Trace:
[SqlException: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.] System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) System.Data.SqlClient.SqlConnection.Open() System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) ProductsPerCategory.DataGridForm.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\ProductsPerCategory\DataGridForm.aspx.vb:79 System.Web.UI.Control.OnLoad(EventArgs e) System.Web.UI.Control.LoadRecursive() System.Web.UI.Page.ProcessRequestMain()[/font]
Could someone help me please?
My Windows account is system administrator in the remote SQL Server. When I open the connection in the Server Explorer, it's all right. But look at this: when I create a ASP.NET web app and drop any table over the form designer, the SqlConnection object that was automatically generated by .NET seems to have troubles during login operation.
The error is given at runtime when I try to fill the dataset using the connection I talked about previously. The error page says:
Server Error in '/ProductsPerCategory' Application.
Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
[font=Arial, Helvetica, Geneva, SunSans-Regular, sans-serif]Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
Source Error:
Line 77: 'Put user code to initialize the page hereLine 78: If Not Me.IsPostBack ThenLine 79: DACategories.Fill(DsCategories1)Line 80: DropDownList1.DataBind()Line 81: End If
Source File: C:\Inetpub\wwwroot\ProductsPerCategory\DataGridForm.aspx.vb Line: 79
Stack Trace:
[SqlException: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.] System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) System.Data.SqlClient.SqlConnection.Open() System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) ProductsPerCategory.DataGridForm.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\ProductsPerCategory\DataGridForm.aspx.vb:79 System.Web.UI.Control.OnLoad(EventArgs e) System.Web.UI.Control.LoadRecursive() System.Web.UI.Page.ProcessRequestMain()[/font]
Could someone help me please?