Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 3rd, 2007, 11:10 AM
b67 b67 is offline
Authorized User
 
Join Date: Sep 2006
Location: , , .
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to b67
Default 2 databases per project

Newb here - so pleae be warned ;)

When trying to run on a non-express server - should I first attach the project DB and modify the connection sting?

Also the asp membership DB - is there one that should be used for all the membership functions/projects or should I be connecting to two databases for every project

I hope the question is clear.

thanks

Reply With Quote
  #2 (permalink)  
Old May 3rd, 2007, 11:21 AM
Imar's Avatar
Wrox Author
Points: 67,581, Level: 100
Points: 67,581, Level: 100 Points: 67,581, Level: 100 Points: 67,581, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,269
Thanks: 66
Thanked 1,428 Times in 1,408 Posts
Default

Hi there,

Are you referring to a specific chapter of the book?

In general, you *can* shared the Membership databases. It all depends on what you want, and whether you want to share the users in it or not.

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.
Reply With Quote
  #3 (permalink)  
Old May 3rd, 2007, 11:53 AM
b67 b67 is offline
Authorized User
 
Join Date: Sep 2006
Location: , , .
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to b67
Default

Imar,

I'm trying to get CH2 to run on a standard edition of sql server which also happens to be the IIS server.

My connection string looks like:
<add name="aserver" connectionString="server=aserver\SQL2005;user id=uxx;password=pxxx;database=fileshare"/>

The server is also running SQL 2000 - which I am not using

I've attached the fileshareDB to sql and it looks ok - I also ran the aspnet_regsql.exe utility on the database - can that be done in place of using the aspnetdb.mdf - to me it would seem much more logical to have the project in a single DB if possible. - I could be going off on a tangent here

I'm still getting the dreaded "error: 26 - Error Locating Server/Instance Specified"

Any insight is appreciated - thanks for your help:D

Reply With Quote
  #4 (permalink)  
Old May 3rd, 2007, 12:06 PM
b67 b67 is offline
Authorized User
 
Join Date: Sep 2006
Location: , , .
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to b67
Default

The error in the server event log is as follows:

Event Type: Warning
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1309
Date: 5/3/2007
Time: 11:41:06 AM
User: N/A
Computer: ASERVER
Description:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 5/3/2007 11:41:06 AM
Event time (UTC): 5/3/2007 3:41:06 PM
Event ID: 670a847405e443888125962b0aaefca4
Event sequence: 2
Event occurrence: 1
Event detail code: 0

Application information:
    Application domain: /LM/W3SVC/1/ROOT/FileShare-1-128226804474350048
    Trust level: Full
    Application Virtual Path: /FileShare
    Application Path: C:\inetpub\wwwroot\FileShare\
    Machine name: ASERVER

Process information:
    Process ID: 3848
    Process name: aspnet_wp.exe
    Account name: GETHERE\IWAM_ASERVER

Exception information:
    Exception type: SqlException
    Exception 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: 26 - Error Locating Server/Instance Specified)

Request information:
    Request URL: http://xxxx.dyndns.tv:8887/fileshare/login.aspx
    Request path: /fileshare/login.aspx
    User host address: 71.175.x.x
    User:
    Is authenticated: False
    Authentication Type:
    Thread account name: GETHERE\IWAM_ASERVER

Thread information:
    Thread ID: 1
    Thread account name: GETHERE\IWAM_ASERVER
    Is impersonating: False
    Stack trace: 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.Security.SqlMembershipProvider.GetPassw ordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate)
   at System.Web.Security.SqlMembershipProvider.CheckPas sword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat)
   at System.Web.Security.SqlMembershipProvider.CheckPas sword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved)
   at System.Web.Security.SqlMembershipProvider.Validate User(String username, String password)
   at System.Web.UI.WebControls.Login.OnAuthenticate(Aut henticateEventArgs e)
   at System.Web.UI.WebControls.Login.AttemptLogin()
   at System.Web.UI.WebControls.Login.OnBubbleEvent(Obje ct source, EventArgs e)
   at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
   at System.Web.UI.WebControls.Button.OnCommand(Command EventArgs e)
   at System.Web.UI.WebControls.Button.RaisePostBackEven t(String eventArgument)
   at System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


Custom event details:



Reply With Quote
  #5 (permalink)  
Old May 3rd, 2007, 12:31 PM
Imar's Avatar
Wrox Author
Points: 67,581, Level: 100
Points: 67,581, Level: 100 Points: 67,581, Level: 100 Points: 67,581, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,269
Thanks: 66
Thanked 1,428 Times in 1,408 Posts
Default

Hi there,

You may want to take a look here:

http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=395

It explains how to configure a remote SQL Server to work with ASP.NET.

You can use a single database, if you want. Some of the chapters use two, others only one. It just depends on your personal preference and whether you want to reuse the same user data across different applications.

So see how to prepare and configure a remote SQL Server for the providers, look here: http://weblogs.asp.net/scottgu/archi...25/423703.aspx

Scott shows you how to override the LocalSqlServer connection string. If you want to see how to override the entire provider settings, including a different ConnectionStringName, look in the web.config file for the BugBase application.

Cheers.

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.
Reply With Quote
  #6 (permalink)  
Old May 3rd, 2007, 12:58 PM
b67 b67 is offline
Authorized User
 
Join Date: Sep 2006
Location: , , .
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to b67
Default

Yes, I've been reading and trying to apply your article since last night but I'm still getting this error - do I have to allow iwam account access to the database - or set ntfs ermission somewhere?

Reply With Quote
  #7 (permalink)  
Old May 3rd, 2007, 01:05 PM
b67 b67 is offline
Authorized User
 
Join Date: Sep 2006
Location: , , .
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to b67
Default

FYI - if I setup a connection via the gui in visual studio - I can test the DB connection without a hitch

Reply With Quote
  #8 (permalink)  
Old May 3rd, 2007, 03:55 PM
Imar's Avatar
Wrox Author
Points: 67,581, Level: 100
Points: 67,581, Level: 100 Points: 67,581, Level: 100 Points: 67,581, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,269
Thanks: 66
Thanked 1,428 Times in 1,408 Posts
Default

Normally, you'd configure the ASPNET or Network Service account.

However, as the article describes this depends on your own configuration. The article describes a number of different scenarios and only you can see what applies to you.

If the server is on a different machine, you may need to set up SQL Server authentication, or use a domain account and use impersonation.

Cheers,

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.
Reply With Quote
  #9 (permalink)  
Old May 3rd, 2007, 04:00 PM
b67 b67 is offline
Authorized User
 
Join Date: Sep 2006
Location: , , .
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to b67
Default

Can anyone tell me a general step by step way to connect to 2 databases (one project the other the membership) for the fileshare project?

I can't believe how much time I have spent on this :( and I bet its something simple

Reply With Quote
  #10 (permalink)  
Old May 3rd, 2007, 04:06 PM
Imar's Avatar
Wrox Author
Points: 67,581, Level: 100
Points: 67,581, Level: 100 Points: 67,581, Level: 100 Points: 67,581, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,269
Thanks: 66
Thanked 1,428 Times in 1,408 Posts
Default

Hi there,

It should be really easy, generally. All providers use a connection string called LocalSqlServer. So, as long as you create a separate connection string for your own stuff and use that in your code, you should be fine.

You can optionally override the LocalSqlServer string as per the articles I posted earlier.

Are there specific areas you're having problems with?

Imar
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Website project vs Web Application Project... thenoseknows ASP.NET 2.0 Professional 0 January 14th, 2007 09:47 PM
How do i Call one project to another project kau_shuk VS.NET 2002/2003 8 December 5th, 2006 10:02 AM
UserControl of One Project in Other Project gadhiav ASP.NET 1.0 and 1.1 Professional 2 February 18th, 2006 07:51 AM
Add report of one project into another project tejaswibv Crystal Reports 0 July 13th, 2005 05:40 AM
From 1 project to get access to another project hplim18 Pro VB.NET 2002/2003 0 March 30th, 2004 10:33 PM



All times are GMT -4. The time now is 08:06 PM.


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