Here is the error message:
Another question, would local host work for server id?
Server Error in '/' Application.
------------------------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) +474
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372
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, String srcTable) +36
ICCSalesTracker.WebForm1.GetRGU() +433
ICCSalesTracker.WebForm1.Page_Load(Object sender, EventArgs e) +7
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
Also, I took a look at PDB file and it still has my other file paths. Does that matter? Should they be changed?
And lastly, The web server admin does not want to use the inetpub folder so he created a different folder that houses all of the files. What will that effect? What do I have to change?
Please let me know. Thanks!!!!|||Hi,
It sounds like the app worked well on your laptop, but wont work when moved to a server. You need to understand the authentication and authorization scheme the app will use to access the DB. That situation may be different from the one you had on your laptop. You can use Windows Integrated security, if IIS and the SQL Server are on the same computer and the user is in the same domain. For an internet app, the client may not have credentials to pass, or passing them posses a risk, so ASP.NET uses a default user for it's worker process called ASPNET (it's called NETWORK SERVICE by Windows 2003 Server). SQL Server sees this default user and checks to see if it has permission to use that DB. In order to gain access to the DB, the ASPNET (or NETWORK SERVICE), user needs to be registered on the SQL Server and given the appropriate (just enough), permissions to use that DB. There are other factors and schemes, but you might just look to see that the SQL Server DB has the right user set up correctly.
Good luck.|||I added ASPNET & NT AUTHORITY and even my domain user is set to owner. It still will not pull it up.|||Hi,
Was the user in the form "NT_AUTHORITY\NETWORK SERVICE"? I know that worked for me one time on a local setup that didn't accept "thecomputername\NETWORK SERVICE". Also, are you sure that these default users have the correct read/write permissions set?
Some more that know more than I do will probably get you the right answer. If I had to figure it out myself, I might try using a different type of Authentication (Forms), just to see if I could get it working - then figure out how to get the authentication scheme I want working too. You might try writting a very simple data access app (using the Data Web Form wizard), just to test the connection. That way you don't have to messup your project.
Good luck.|||Thank you for your help Brian!
Well I figured out the server name. Apparently, if the server say local when you look at it in Enterprise Manager, you leave the sql servername blank in the connection string. "SERVER/"
Now I"m getting a login failed for user 'NT AUTHORITY\NETWORK SERVICE error even though IIS is set to windows integrated authentication. Is there another place I have to change a setting to ensure it only uses windows authentication?|||Hi,
Glad to hear that you are making some progress - even if my info wasn't much help.
Is the login error message from SQL Server?
In your message it says ...for user 'NT AUTHORITY\NETW...', but I think it should have an underscore between NT and AUTHORITY -- 'NT_AUTHORITY\NETWORK SERVICE'
It seemed odd to me that they connect the first two part name, and leave a blank in the second, but that's the way I saw it on my system. Double check.
Good luck.|||You are correct. I typed it in wrong. I had to add that user to the SQL users directory and now it loads. But now I have yet another problem. The initial page loads. It has an onload function that calls a stored procedure to return the number of units sold for the day. That works just fine. The second part of the page is the order entry function that passes parameters to an insert procedure. When I click on submit, I get an access denied or server not found error. It's wierd because it's using the same connection string as the on load procedure. Do you have any idea what that might be? Thanks for the help!|||Hi,
Looks like you are making progress.
I'm not sure about why the second part of the page wont function. My first guess is that the first part is only reading data, and it sounds like the second part is reading and writing. Are you sure that the user permissions include insert and update allowed?
You need to be very careful with any database access granted to internet users. That's even more the case when you grant write or execute permissions. Keep in mind that it's one thing to get it working, but you'll want to make sure you have the security issues understood and accounted for before you deploy the application. I'm still working my way through this myself. Using stored procedures for the functions that your users will perform is generally a good idea, but they're not a security panacea. You'll have to do some research to find the best safegaurds. I know that MSDN has some series on security best practices, webcasts, etc...
One other thing occurs to me, if you don't have a compelling reason to have both the functions you mentioned on the same aspx page, consider moving the second to another page, with a link from the first. My thought is that it compartmentalizes the functions, and it could make it easier to track down problems, and keep the first function available, even if the other is broken. You'll know if it makes sense to do this in your project.
Let me know how it goes for you.|||All of the required users have permissions to all of the objects in the database. This is an intranet and the security is set to windows integrated. The reason the page has both the on load and on submit function is to track entered units in real time. As they enter in sales, the datagrid tied to the getunit stored procedure runs every time the page loads. So when the sales agent enters in 2 revenue units, datagrid reflects those units when the page reloads. That portion works just fine. However when I click submit, I get the following error
Server Error in '/' Application.
------------------------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) +474
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372
System.Data.SqlClient.SqlConnection.Open() +384
ICCSalesTracker.WebForm1.btnSubmit_Click(Object sender, EventArgs e) +7239
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292
I'm pretty sure it's not the connection string as that is specified in the web.config file. I'm thinking it has something to do with IIS or something. Thanks for the help! I'll let you know if I figure it out...
No comments:
Post a Comment