p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 (http://p2p.wrox.com/forumdisplay.php?f=228)
-   -   SQL SERVER 2005 STANDARD (not express) (http://p2p.wrox.com/showthread.php?t=52328)

proslambano January 5th, 2007 06:42 PM

SQL SERVER 2005 STANDARD (not express)
 
ok, I've tried to get the full website running on 2 different windows xp sp2 machines. Both machines have VS 2005 Professional and SQL server 2005 standard

I've attached aspnetdb and wroxunited databases to sql server studio and changed the owner for each to 'sa'.

In VS, I opened the wroxunited website at c:\websites\wroxunited. Then in vs, I changed the connection info for each data connection (in Server Explorer) to use Microsoft SQL Server (SqlClient)data source, and sql server Authentication - the Test connection is successful for both aspnetdb and wroxunited.

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: 25 - Connection string is not valid)"

When I run on IIS on my laptop, I get this:
ERROR: 400.100 Bad Request
HResult: 0x80004005
Source: Microsoft SQL isapi extension
Description: Query not specified

System.Data.SqlClient.SqlException was unhandled by user code
  Class=20
  ErrorCode=-2146232060
  LineNumber=0
  Message="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: 25 - Connection string is not valid)"
  Number=87
  Server=""
  Source=".Net SqlClient Data Provider"
  State=0
  StackTrace:
       at System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner, Boolean& failoverDemandDone, String host, String failoverPartner, String protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject, Boolean aliasLookup)
       at System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
       at System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
       at System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
       at System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
       at System.Data.SqlClient.SqlConnection.Open()
       at System.Web.DataAccess.SqlConnectionHolder.Open(Htt pContext context, Boolean revertImpersonate)
       at System.Web.DataAccess.SqlConnectionHelper.GetConne ction(String connectionString, Boolean revertImpersonation)
       at System.Web.Profile.SqlProfileProvider.GetPropertyV aluesFromDatabase(String userName, SettingsPropertyValueCollection svc)
       at System.Web.Profile.SqlProfileProvider.GetPropertyV alues(SettingsContext sc, SettingsPropertyCollection properties)
       at System.Configuration.SettingsBase.GetPropertiesFro mProvider(SettingsProvider provider)
       at System.Configuration.SettingsBase.GetPropertyValue ByName(String propertyName)
       at System.Configuration.SettingsBase.get_Item(String propertyName)
       at System.Web.Profile.ProfileBase.GetInternal(String propertyName)
       at System.Web.Profile.ProfileBase.get_Item(String propertyName)
       at System.Web.Profile.ProfileBase.GetPropertyValue(St ring propertyName)
       at ProfileCommon.get_Theme() in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET Files\wroxunited\2112705c\14c1a696\App_Code.ladly7 gj.6.vb:line 114
       at Wrox.Web.GlobalEvents.ThemeModule.app_PreRequestHa ndlerExecute(Object Sender, EventArgs E) in C:\Websites\WroxUnited\App_Code\ThemeModule.vb:lin e 30
       at System.Web.HttpApplication.SyncEventExecutionStep. System.Web.HttpApplication.IExecutionStep.Execute( )
       at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously)


Sincerely,
Brian

Imar January 5th, 2007 07:06 PM

Quote:

quote:provider: SQL Network Interfaces, error: 25 - Connection string is not valid
This seems to suggest there's something wrong with the connection string. How does it look?

And how does your SQL statement look like? Did you try a simple SELECT statement?

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.

proslambano January 5th, 2007 07:38 PM

Quote:

quote:Originally posted by Imar
 
Quote:

quote:provider: SQL Network Interfaces, error: 25 - Connection string is not valid
This seems to suggest there's something wrong with the connection string. How does it look?

And how does your SQL statement look like? Did you try a simple SELECT statement?

Imar
Imar, Thanks.

I was getting frustrated, but I finally got it figured out for Cassini on my laptop. I realized with trial and error that I could choose advanced and set the properties THEN copy the connection string that is auto-built in the advanced window. So now it looks like this:

Data Source=MYLAPTOP;Initial Catalog=WROXUNITED.MDF;Persist Security Info=True;User ID=sa;Password=mypassword;Network Library=dbmssocn

I had to specifically use the TCP as well because I was getting a named pipes error (it thinks for some reason that pipes aren't open on the SQL end, but I do have them configured that way.

Also, I found there is no need to comment out the call to themes from Web.config now that the connection info is good, as was suggested somewhere in Lightwaver's thread. I'm using a modification of Lightwaver's connection string, as posted previously...

I'm such a newb! lol... here's my connection string to replace in web.config for others that may have the same problem using SQL server 2005 STANDARD

    <connectionStrings>
        <remove name="LocalSqlServer"/>
        <add name="LocalSqlServer" connectionString="Data Source=MYLAPTOP;Initial Catalog=G:\BEGASPNET2\FINALAPPLICATION\WROXUNITED\ APP_DATA\ASPNETDB.MDF;Persist Security Info=True;User ID=sa;Password=mypassword;Network Library=dbmssocn"/>
        <add name="WroxUnited" connectionString="Data Source=MYLAPTOP;Initial Catalog=WROXUNITED.MDF;Persist Security Info=True;User ID=sa;Password=mypassword;Network Library=dbmssocn" />
    </connectionStrings>


Sincerely,
Brian

Imar January 5th, 2007 07:43 PM

Glad it's working.

For a lot more information about having SQL Server and ASP.NET play nice together, you can also take a look here: http://Imar.Spaanjaars.Com/QuickDocId.aspx?quickdoc=395

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.

proslambano January 5th, 2007 07:58 PM

Thanks, I'll check out the site. Mayber there's some info there on working with IIS??? I keep getting this error:
ERROR: 400.100 Bad Request
HResult: 0x80004005
Source: Microsoft SQL isapi extension
Description: Query not specified


Sincerely,
Brian

Imar January 5th, 2007 08:00 PM

0x80004005 errors are almost always related to security problems. However, that's hard to tell without seeing your code as the error message also suggests there's something wrong with your query.

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.

proslambano January 5th, 2007 08:04 PM

it's the WroxUnited application.

Sincerely,
Brian

Imar January 6th, 2007 10:21 AM

I don't have the book, so I don't know what code you're talking about... ;)

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
While typing this post, I was listening to: Sporen by Opgezwolle (Track 1 from the album: Vloeistof) What's This?

proslambano January 8th, 2007 08:55 PM

Imar,

that isapi error appears to be related to using SQLXML 3.0 Virtual Dir Management in connection with SQL "Standard". When I had SQL Express installed, the SQLXML 3.0 virt tool worked well, but not so well with SQL Standard (2005). From what I can glean, it appears SQL 2005 Standard has SQLXML 4.0 built in. Perhaps the Express SQL didn't have any version of SQLXML built in, that's why the version 3.0 works with SQL Express.

Anyhoo, thank you so much for your help!!

Oh, I get to these forums via the link from the page for "Beginning ASP.NET 2.0", and it is this book that goes through the WroxUnited application. I mistakenly assumed you got here through the same route :)


Sincerely,
Brian


All times are GMT -4. The time now is 04:28 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.