Last post May 01, 2007 12:54 PM by pleaseHelp886
Apr 30, 2007 01:33 PM|darrent|LINK
My mobile web application using aspx cannot access from localhost.
It prompt msg as below when i manually open internet explorer and key in the path "http://localhost/myapplication/default.aspx" when i try to access sql server 2005 data.
But when i use debug function in visual studio 2005 to open the application, data from sql server 2005 can be accessed & shown.
can anyone let me know what is my problem?
Line 24: Line 25: Dim sql As String = "SELECT * FROM project"Line 26: sqlConn.Open()Line 27: Line 28: Dim da As SqlDataAdapter = New SqlDataAdapter(sql, sqlConn)
Apr 30, 2007 02:04 PM|SKT_01|LINK
May 01, 2007 01:49 AM|pleaseHelp886|LINK
Ya...Below is my connection string:
Dim connectionString = "Data Source=user-1221;Initial Catalog=surveyAspx;Integrated Security=True"
Dim sqlConn As SqlConnection = New SqlConnection(connectionString)
Dim sql As String = "SELECT * FROM project"
Dim da As SqlDataAdapter = New SqlDataAdapter(sql, sqlConn)
Dim ds As DataSet = New DataSet()
' Fill the DataSet
But when i use visual studio debug button to run the application, it didn't show connection problem & i can connect to db and run the whole application.
May 01, 2007 02:00 AM|pleaseHelp886|LINK
Below is my connection string & code:
I already put the folder of application in this path "C:\Inetpub\wwwroot" & add it to IIS web application.
When i try to access it manually with this path
http://localhost/mobilesurvey/default.aspx, message as previous post shown.
But the same message didn't pop up when i using visual studio 2005 debug button to run the application.
When i using the debug function in vs 2005, i can connect to db & access the whole application without problem.
May 01, 2007 02:08 AM|pleaseHelp886|LINK
Sorry for the duplicate post. But the 1st time when i post, page shown loss conection.
May 01, 2007 03:43 AM|SKT_01|LINK
It seems that the ASPNET account has no permission to access the SQL Server.
This Knowledge Base article might help you.
If you debug the application with Visual Studio are you using IIS or the built in Development Server? The Dedevelopment Server might run in another security context as IIS which has sufficient permissions to access the database server.
May 01, 2007 12:54 PM|pleaseHelp886|LINK
Thanks for your help.
i have rectify the problem.
connectionString = "Data Source= ;Initial Catalog= ;Integrated Security=True"
I replace the connection string with user/password connection string.
connectionString = "Data Source= ;Initial Catalog= ;User ID= ;password= "
Now already can work
Thanks a lot.