on 05-23-2006 9:55 PM
Any help would be appreciated. I'm trying to create a portal application with the dotnet pdk. I need to connect to a SQL Server database.
When I run the application in the portal I'm getting the following error:
Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
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:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.]
System.Data.SqlClient.ConnectionPool.CreateConnection() +402
System.Data.SqlClient.ConnectionPool.UserCreateRequest() +147
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +391
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +311
System.Data.SqlClient.SqlConnection.Open() +384
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +38
PortalApplication2.PortalComponent1.Page_Load(Object sender, EventArgs e)
System.Web.UI.Control.OnLoad(EventArgs e) +55
SAP.Portal.Web.UI.PortalComponent.OnLoad(EventArgs e) +17
System.Web.UI.Control.LoadRecursive() +27
System.Web.UI.Control.LoadRecursive() +90
System.Web.UI.Control.LoadRecursive() +90
System.Web.UI.Page.ProcessRequestMain() +750
All,
Similarly, I'm using a credentials-provided method (instead of Windows Authentication) and I'm getting this:
-
SQL Server does not exist or access denied.
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: SQL Server does not exist or access denied.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException: SQL Server does not exist or access denied.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +483
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +311
System.Data.SqlClient.SqlConnection.Open() +383
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +38
JobsPortalApp.JobIView.btnSubmit_Action(Object sender, ActionEventArgs e) in d:\projects\optiant\jobsportalapp\jobiview.ascx.cs:137
SAP.Web.UI.Controls.AbstractButton.OnAction(ActionEventArgs e) +88
SAP.Web.UI.Controls.AbstractButton.RaisePostBackEvent(String eventArgument) +121
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +138
System.Web.UI.Page.ProcessRequestMain() +1292
-
My ConnectionString is as follows:
workstation id=APOLLO_2;packet size=4096;user id=sa;data source=APOLLO_2;persist security info=True;initial catalog=SAPExperiment;password=password
(that's right! sa/password! :P)
APOLLO_2 is my local machine that hosts a SQL Server 2000 instance. I can compile, deploy, run and see the iView. The application I'm writing is Tutorial 2 from the Developer's "manual", with one caveat: Instead of using Form_Load() to do all the dataset filling, and binding, I'm using an SAP Button. It was to my understanding that there wasn't anything else special to do considering the shortness of Tutorial 2... Any ideas?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joseph,
Some simple suggestions:
Try connecting to this same server from the server explorer (with the same settings), see if that works. If not - you have a problem with these settings. If yes - drag the created connection to your designer and use that to get the connection string.
Also try using "localhost" or "." instead of machine name.
Regards,
Ofer
Ofer,
PortalServerMachine: SAPLAB1 (SAP software, no SQL Server)
MyDevelopmentMachine: APOLLO_2 (VisualStudio2K3, .NET 1.1, SQL Server 2000)
Using 'localhost' or '.' may not work in this situation because once I deploy the iView to the Portal, 'localhost' really means 'SAPLAB1' and not 'APOLLO_2'. Is there some setting on the SAP Portal level that I might need to take a look at and configure? Or do some of you think that this is a network-infrastructure-level issue (i.e. DNS Server not resolving 'APOLLO_2', etc...)?
It seems that you are using a connection string that doesn't contain a username and a password - instead relies on Windows Authentication.
This must be configured in SQL server Enterprise Manager:
Got to "Security -> Logins" -> "New Login...". Add the Windows User that is used to run the PDK Runtime Service. I don't know in the moment which is it is - maybe you can also configure this.
Alternatively you use a connection string with username and password. Note that you may need to enable this so-called "SQL Server Authentication" in SQL Enterprise Manager.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Julie,
Can you post your connection string?
Are you able to connect to the DB by using Server Explorer?
Omri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My connection string is:
workstation id=MyComputerName;packet size=4096;integrated security=SSPI;data source=MyServerName;persist security info=False;initial catalog=ERPKPI
I've also tried persist security info = True
but that didn't work either.
I'm trying to use the Network Security to retrieve the data, instead of a specific name and password. In Server Explorer, I can see the database and everything it contains.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.