Can anybody helps me . I am trying to work on my personal website using Personal Site Starter Kit. Unfortunately my server can't connect to the database. Can you have a look at my cxonnecton string and tell me what I'm doing wrong? Thank you.
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces,
error: 26 - Error Locating Server/Instance Specified)
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: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not
allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
Source Error:
Line 194: Using command As New SqlCommand("GetNonEmptyAlbums", connection)
Line 195: command.CommandType = CommandType.StoredProcedure
Line 196: connection.Open()
Line 197: Dim list As New Generic.List(Of Album)()
Line 198: Using reader As SqlDataReader = command.ExecuteReader
you are using SQLExpress, is your SqlExpress installed on the same machine as your application, or on another machine?!
If on another machine then you should know that SQLServer Express Edition can only be accessed from the machine it was installed on. It doesn't allow remote connection from exprenal machines or sources.
Start > Programs > SqlServer2005 >
ConfigurationTools > SQLServerSurfaceAreaConfiguration >ClickSurface
AreaConfigurationFor Services and Connections > Click
Remote Connections > Click Local and Remote connections and within that Select Using both TCP/IP and named Pipes >
Apply > Ok...
Thank you for all your answers, but I have to let you know that on my local machine evrything works fine, but once I try to run it on a live server I've got that error.
Have you applied the suggested change on the remote SQL server?
Click "Mark as Answer" on the post that helped you.
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
Yes that is what I mentioned in my response. SQLExpress is for local use only, you cannot connect to it remotely using Management Studio or any other application including Web Application.
Sorry guys, I thought I showed you my new connection string with the new error. In fact I asked my host to correct my connection string and this is what they gave me so now I've got another error. Have a look. Thank you
Could not find stored procedure 'GetNonEmptyAlbums'.
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: Could not find stored procedure 'GetNonEmptyAlbums'.
Source Error:
Line 196: connection.Open()
Line 197: Dim list As New Generic.List(Of Album)()
Line 198: Using reader As SqlDataReader = command.ExecuteReader
Line 199: Do While reader.Read
Line 200: Dim temp As New Album(CType(reader("AlbumID"), Integer), 0, "", False)
Something to do with the Store Procedure, but I haven't got a clue. Please help. Thank you
are you saying that Im not calling the right database (Personal). I check to see if there was any stored procedure called GetNonEmptyAlbums but I couldnt find any. So what shall I do now?
No I am saying that this procedure is not included in the database. What to do, simply check your local database, in your development server or development machine, seach for this procedure and put it into your production database.
Make sure that all procedures are imported to your production database.
Member
1 Points
5 Posts
SQL Server Problem
Jul 11, 2008 07:21 AM|enz54|LINK
Can anybody helps me . I am trying to work on my personal website using Personal Site Starter Kit. Unfortunately my server can't connect to the database. Can you have a look at my cxonnecton string and tell me what I'm doing wrong? Thank you.
Participant
1370 Points
349 Posts
Re: SQL Server Problem
Jul 11, 2008 07:48 AM|mosessaur|LINK
you are using SQLExpress, is your SqlExpress installed on the same machine as your application, or on another machine?!
If on another machine then you should know that SQLServer Express Edition can only be accessed from the machine it was installed on. It doesn't allow remote connection from exprenal machines or sources.
Software Engineer
Contributor
6730 Points
1366 Posts
Re: SQL Server Problem
Jul 11, 2008 07:58 AM|siva_sm|LINK
Participant
1232 Points
450 Posts
Re: SQL Server Problem
Jul 12, 2008 04:43 AM|Talib_dotnet|LINK
Hi,
Follow these steps..
Start > Programs > SqlServer2005 > ConfigurationTools > SQLServer SurfaceArea Configuration >Click Surface Area Configuration For Services and Connections > Click Remote Connections > Click Local and Remote connections and within that Select Using both TCP/IP and named Pipes > Apply > Ok...
Then try to run your application .....
Hope this helps....
Talib Ali Khan
Blog
Member
1 Points
5 Posts
Re: SQL Server Problem
Jul 14, 2008 05:32 AM|enz54|LINK
Thank you for all your answers, but I have to let you know that on my local machine evrything works fine, but once I try to run it on a live server I've got that error.
thank you
All-Star
44551 Points
13496 Posts
MVP
Re: SQL Server Problem
Jul 14, 2008 05:39 AM|TATWORTH|LINK
Have you applied the suggested change on the remote SQL server?
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
Participant
1370 Points
349 Posts
Re: SQL Server Problem
Jul 14, 2008 05:40 AM|mosessaur|LINK
Yes that is what I mentioned in my response. SQLExpress is for local use only, you cannot connect to it remotely using Management Studio or any other application including Web Application.
Only local applications can do that
Software Engineer
Member
1 Points
5 Posts
Re: SQL Server Problem
Jul 14, 2008 06:09 AM|enz54|LINK
Sorry guys, I thought I showed you my new connection string with the new error. In fact I asked my host to correct my connection string and this is what they gave me so now I've got another error. Have a look. Thank you
<connectionStrings>
<add name="Personal" connectionString="Data Source=xx.xx.xx.xx;Initial Catalog=xxx_personal;User ID=xxxxxx;Password=xxxxxxxx" providerName="System.Data.SqlClient" />
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=xx.xx.xx.xx;Initial Catalog=ASPNETDB.MDF;User ID=xxxxxxx;Password=xxxxxxxxx" providerName="System.Data.SqlClient" />
</connectionStrings>
we use SQL server 2005 not Express
This is the error:
Server Error in '/XXXXXXX' Application.
Could not find stored procedure 'GetNonEmptyAlbums'.
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: Could not find stored procedure 'GetNonEmptyAlbums'.
Source Error:
Participant
1370 Points
349 Posts
Re: SQL Server Problem
Jul 14, 2008 06:18 AM|mosessaur|LINK
You are calling a stored procedure in your database that doesn't exits! this procedure called "GetNonEmptyAlbums"
Make sure that you upload your database correctly with all stored procedures from your local development server to your hosting\production server.
I bit you are using the Personal connection string so make sure that this database include a stored proc called "GetNonEmptyAlbums"
Software Engineer
Member
1 Points
5 Posts
Re: SQL Server Problem
Jul 14, 2008 06:42 AM|enz54|LINK
are you saying that Im not calling the right database (Personal). I check to see if there was any stored procedure called GetNonEmptyAlbums but I couldnt find any. So what shall I do now?
Thank you
Participant
1370 Points
349 Posts
Re: SQL Server Problem
Jul 14, 2008 06:57 AM|mosessaur|LINK
No I am saying that this procedure is not included in the database. What to do, simply check your local database, in your development server or development machine, seach for this procedure and put it into your production database.
Make sure that all procedures are imported to your production database.
Software Engineer