Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8
This is the forum to discuss the Wrox book Beginning ASP.NET 2.0 by Chris Hart, John Kauffman, David Sussman, Chris Ullman; ISBN: 9780764588501
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 10th, 2006, 05:48 PM
Registered User
 
Join Date: May 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Beginning ASP.NET 2.0 and VS2005

Hello!

Im new to asp, but have a question if its possible to use VS2005 instead of VWD and sqlserver 2000?

If it is, how do I make use of the finish example site installtion I'm having problems when trying to run it.

I unzipped the zip file under my websites opened it up in vs2005 and tried to run it but got an error saying

System.ArgumentException was unhandled by user code
Message="An error occurred while attempting to initialize a System.Data.SqlClient.SqlConnection object. The value that was provided for the connection string may be wrong, or it may contain an invalid syntax.
Parameter name: connectionString"
ParamName="connectionString"
Source="System.Web"
StackTrace:
     at System.Web.DataAccess.SqlConnectionHolder..ctor(St ring connectionString)
     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\1215bf01\56427e30\App_Code.6wkdai kj.6.vb:line 114
     at Wrox.Web.GlobalEvents.ThemeModule.app_PreRequestHa ndlerExecute(Object Sender, EventArgs E) in C:\Documents and Settings\AMT4\My Documents\Visual Studio 2005\WebSites\WroxUnited\App_Code\ThemeModule.vb:l ine 30
     at System.Web.HttpApplication.SyncEventExecutionStep. System.Web.HttpApplication.IExecutionStep.Execute( )
     at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously)
 
Old May 11th, 2006, 10:40 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Yes, you can. Take a look at this blog to see how to configure SQL Server 2000

http://weblogs.asp.net/scottgu/archi...25/423703.aspx

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old May 11th, 2006, 05:28 PM
Registered User
 
Join Date: May 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you Imar that sorted out one problem. Now when trying to attach the wroxunited db , I get into new problems. I'm trying to run

EXEC sp_attach_db @dbname = 'WroxUnited',
     @filename1 = 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\db\WroxUnited.mdf',
     @filename2 = 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\db\WroxUnited_Log.LDF'

but ends up with a an error saying:

Server: Msg 602, Level 21, State 50, Line 1
Could not find row in sysindexes for database ID 9, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexes.

Connection Broken

And I am not able to solve this no database is getting created. So I can't run and DBCC towards it.

Is it possible to get the sql script to create the tables and data instead? I did a search but could not find any

Thanks again.
Lars

 
Old May 12th, 2006, 12:04 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Are you trying to attach the 2005 version of the database to an instance of SQL 2000???

That won't work.

You may be able to script out the database and then run the script in SQL 2000, but I am not sire if that will work. When the databases uses new 2005 features (MAX, CTPs etc), you won't be able to transfer those to 2000.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old May 13th, 2006, 06:14 AM
Registered User
 
Join Date: May 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have not installed sqlserver 2005, but are facing problems when trying to build the final version that comes with the book zip package.

I vs2005 wroxunited website webconfig I have

 <connectionStrings>
     <add name="WroxUnited"
      connectionString="Data Source=LKDESKTOP\SQL2005;Initial Catalog=WroxUnited;Integrated Security=True;User Instance=True"
      providerName="System.Data.SqlClient" />
    <remove name="LocalSqlServer"/>
    <add name="LocalSqlServer" connectionString="Data Source=LKDESKTOP\SQL2005;Initial Catalog=aspnetdb;Integrated Security=True" providerName="System.Data.SqlClient"/>
  </connectionStrings>

When building the page I get no errors but when trying to access the site within from vs I get:

Server Error in '/WroxUnited' Application.
The user instance login flag is not supported on this version of SQL Server. The connection will be closed.
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: The user instance login flag is not supported on this version of SQL Server. The connection will be closed.

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 (0x80131904): The user instance login flag is not supported on this version of SQL Server. The connection will be closed.]
   System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection) +171
   System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject stateObj) +199
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2305
   System.Data.SqlClient.SqlInternalConnectionTds.Com pleteLogin(Boolean enlistOK) +34
   System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +606
   System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +193
   System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +218
   System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
   System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection owningObject) +429
   System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection owningObject) +70
   System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection owningObject) +512
   System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection owningConnection) +85
   System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +89
   System.Data.SqlClient.SqlConnection.Open() +160
   System.Data.Common.DbDataAdapter.FillInternal(Data Set dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +118
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +139
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83
   System.Web.UI.WebControls.SqlDataSourceView.Execut eSelect(DataSourceSelectArguments arguments) +1659
   System.Web.UI.WebControls.Repeater.GetData() +50
   System.Web.UI.WebControls.Repeater.CreateControlHi erarchy(Boolean useDataSource) +214
   System.Web.UI.WebControls.Repeater.OnDataBinding(E ventArgs e) +53
   System.Web.UI.WebControls.Repeater.DataBind() +62
   System.Web.UI.WebControls.Repeater.EnsureDataBound () +55
   System.Web.UI.WebControls.Repeater.OnPreRender(Eve ntArgs e) +13
   System.Web.UI.Control.PreRenderRecursiveInternal() +88
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5663


 
Old May 13th, 2006, 06:28 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Take a look at your connection string:

 <add name="WroxUnited"
      connectionString="Data Source=LKDESKTOP\SQL2005;Initial Catalog=WroxUnited;Integrated Security=True;User Instance=True"
      providerName="System.Data.SqlClient" />

If features a number of SQL 2005 only features:

LKDESKTOP\SQL2005
This points to a named instance of SQL 2005, which won't work if you don't have it installed.

User Instance=True
This is a new feature in SQL 2005 only. When connection to a SQL 2000 database, this won't work.

If that doesn't help, I think you need to describe your situation in a bit more detail. E.g. the database you are using, the connection string you're trying to use and so on.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old May 13th, 2006, 06:46 AM
Registered User
 
Join Date: May 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello I am using sql server 2005 made a typo in my previous message, I typed I have "not" whiles I it should have been I have now sorry for that.

So basically I have SQL server 2005 installed
This is what I've done.

1. Installed SQL server 2005
2. ran aspnet_regsql.exe and created the db against LKDESKTOP\SQL2005
(my hostname\instance)
3. Unzipped the wroxunited app to a local folder on my pc
4. Logged on to sql server management studio and attached the Wroxunited .mdf
5. Started VS2005 ->open website->broswed to my folder where I have unzipped all the files.
6. Edited the webconfig file connections strings as I told in my previous mail
7. Tested the asp.net configuration - OK
8. Build the app
9 When the browser opens I get the error that I posted i previous message .

Any hints what could be wrong or what I should try would be most appreciated, maybee I should give up and use the sql express version instead..

Thanks
Lars - Swedish beginner


 
Old May 13th, 2006, 07:13 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Right, I see. In that case, drop the User Instance=True from the connection string.

As the error message points out, this option is not supported on your version of SQL Server.

You may want to take a look here: http://msdn.microsoft.com/library/de...xpuserinst.asp for more info about the user instance and SQL Server Express (on which it is supported only).

Imar
 
Old May 14th, 2006, 07:37 AM
Registered User
 
Join Date: May 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Exellent Imar, that did the trick. Everythings seems to work now.

Though it's pity that I have to change the connections string in all examples but I can live with that I think.

Thanks again Imar for all the help. I'll now start working on the Bok "beginning ASP.NET 2.0", looking forward to this.

Cheers
Lars

 
Old May 14th, 2006, 07:56 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
quote:Though it's pity that I have to change the connections string in all examples but I can live with that I think.
In that case, you're much better off installing SQL Server Express as well. Both installations of SQL Server can live side by side.

Using the Express version will make it much easier to run the example (not only those from the book, but many others as well because quite often it's assumed there is a SQL Server instance called (local)\SqlExpress).

Once you're done developing your site with the Express edition, it's pretty easy to move the database to a "real" version of SQL Server....

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004





Similar Threads
Thread Thread Starter Forum Replies Last Post
Learn Professional ASP.NET using VS2005 Express glam ASP.NET 2.0 Professional 0 December 1st, 2005 06:19 PM
Can'T find code to Beginning Asp.net using VB.NET darruler All Other Wrox Books 1 August 12th, 2004 05:04 PM
Help 'beginning asp.net using vb.net' source code jkmf Wrox Book Feedback 1 January 18th, 2004 08:09 AM
Beginning ASP.Net Databases Using VB.Net ISBN 6195 tlamazares SQL Server ASP 1 December 15th, 2003 01:28 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.