Sunday, February 19, 2012

Form view/sqlexpress/

i getting the following error message in runtime, i have no idea what my username and password is for my computer, does anyone know what this error message means, and how i can get my username and password.

Server Error in '/' Application.

Cannot open user default database. Login failed.
Login failed for user 'ACER-0BCB4DEC3A\ASPNET'.

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: Cannot open user default database. Login failed.
Login failed for user 'ACER-0BCB4DEC3A\ASPNET'.

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): Cannot open user default database. Login failed.Login failed for user 'ACER-0BCB4DEC3A\ASPNET'.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +735107 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +84 System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +197 System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +1121 System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105 System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42 System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +83 System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +160 System.Web.UI.WebControls.Login.AttemptLogin() +105 System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35 System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102



Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

P.s Also does any one know how to enable cookies for the login control on website.

i have noticed within the objectdatasource wizard, that something called profile is there, and this is where you specify the cookies, sessions etc. But i dont know where to start with this. Can anyone help?

thanks

andy

Your SQL problem could be a number of things.

You can try things like right clicking on your connection to the database inside VS2005 express and choosing close connection to see if maybe you're taking up the only connection, or you can create a new user for your sql express file and then change your connection string to use that instead of (presumably) integrated security.

Do you have SQL server studio express, with it you can probably get a better handle on your SQL express installation, including setting up users/passwords.

http://www.microsoft.com/downloads/details.aspx?FamilyID=82afbd59-57a4-455e-a2d6-1d4c98d40f6e&DisplayLang=en

In regards to your cookies, by default they are enabled, but the forms authentication timeout defaults to 0 seconds, meaning that as soon as you close your browser it will go away. If you add/change your timeout value like I've done below, you'll have cookies able to last for as long as you set it (I choose 20160 for 2 weeks).

<

formsname=".ASPXAUTH"loginUrl="login.aspx"defaultUrl="default.aspx"protection="All"timeout="20160"path="/"requireSSL="false"slidingExpiration="true"cookieless="UseDeviceProfile"domain=""enableCrossAppRedirects="false">

</

forms>|||Do I put this inside the web.config file or my login.aspx file|||

Here is an example web.config, hope this helps!

<!-- Note: As an alternative to hand editing this file you can use the web admin tool to configure settings for your application. Use the Website->Asp.Net Configuration option in Visual Studio. A full list of settings and comments can be found in machine.config.comments usually located in \Windows\Microsoft.Net\Framework\v2.x\Config --><configuration> <appSettings/> <connectionStrings> <add name="MainConnectionString" connectionString="Password={password};Persist Security Info=True;User ID={userid};Initial Catalog={databasename};Data Source={ipaddress of server or what have you}" providerName="System.Data.SqlClient"/> </connectionStrings> <system.web><!-- Set compilation debug="true" to insert debugging symbols into the compiled page. Because this affects performance, set this value to true only during development. Visual Basic options: Set strict="true" to disallow all data type conversions where data loss can occur. Set explicit="true" to force declaration of all variables. --> <compilation debug="false" strict="false" explicit="true" /> <pages> <namespaces> <clear /> <add namespace="System" /> <add namespace="System.Collections" /> <add namespace="System.Collections.Specialized" /> <add namespace="System.Configuration" /> <add namespace="System.Text" /> <add namespace="System.Text.RegularExpressions" /> <add namespace="System.Web" /> <add namespace="System.Web.Caching" /> <add namespace="System.Web.SessionState" /> <add namespace="System.Web.Security" /> <add namespace="System.Web.Profile" /> <add namespace="System.Web.UI" /> <add namespace="System.Web.UI.WebControls" /> <add namespace="System.Web.UI.WebControls.WebParts" /> <add namespace="System.Web.UI.HtmlControls" /> </namespaces> </pages><!-- The <authentication> section enables configuration of the security authentication mode used by ASP.NET to identify an incoming user. --> <authentication mode="Forms" > <forms name=".ASPXAUTH" loginUrl="login.aspx" defaultUrl="default.aspx" protection="All" timeout="20160" path="/" requireSSL="false" slidingExpiration="true" cookieless="UseDeviceProfile" domain="" enableCrossAppRedirects="false"></forms> </authentication><!-- The <customErrors> section enables configuration of what to do if/when an unhandled error occurs during the execution of a request. Specifically, it enables developers to configure html error pages to be displayed in place of a error stack trace. <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"> <error statusCode="403" redirect="NoAccess.htm" /> <error statusCode="404" redirect="FileNotFound.htm" /> </customErrors> --> </system.web></configuration>
|||

This is my web config file now, what do i put in the form name and path fields?:

<?

xmlversion="1.0"?>

<

configurationxmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

<

connectionStrings>

<

addname="ASPNETDBConnectionString"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Inetpub\wwwroot\vwd test\web-css-take-it-further - modified in vwd\App_Data\ASPNETDB.MDF";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

<

addname="ASPNETDBConnectionString2"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Inetpub\wwwroot\vwd test\web-css-take-it-further - modified in vwd\App_Data\ASPNETDB.MDF";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

<

addname="ASPNETDBConnectionString3"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Inetpub\wwwroot\vwd test\web-css-take-it-further - modified in vwd\App_Data\ASPNETDB.MDF";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

</

connectionStrings>

<

system.web>

<

roleManagerenabled="true" />

<

authenticationmode="Forms" >

<

formname=".ASPXAUTH"loginUrl="Login.aspx"defaultUrl="threecolumn.aspx"protection="All"timeout="20160"path="/"requireSSL="false"slidingExpiration="true"cookieless="UseDeviceProfile"domain=""enableCrossAppRedirects="false">

</

form>

</

authentication>

<

compilationdebug="true"/>

<

anonymousIdentificationenabled="true" />

<

profile>

<

properties>

<

addname="PostalCode"type="System.String"allowAnonymous="true" />

</

properties>

</

profile>

</

system.web>

<

system.net>

<

mailSettings>

<

smtpfrom="andy.hillyard@.ntlworld.com">

<

networkhost="smtp.ntlworld.com"password=""userName="" />

</

smtp>

</

mailSettings>

</

system.net>

</

configuration>

i

am|||

This is my web config file now, what do i put in the form name and path fields?:

<?

xmlversion="1.0"?>

<

configurationxmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

<

connectionStrings>

<

addname="ASPNETDBConnectionString"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Inetpub\wwwroot\vwd test\web-css-take-it-further - modified in vwd\App_Data\ASPNETDB.MDF";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

<

addname="ASPNETDBConnectionString2"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Inetpub\wwwroot\vwd test\web-css-take-it-further - modified in vwd\App_Data\ASPNETDB.MDF";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

<

addname="ASPNETDBConnectionString3"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Inetpub\wwwroot\vwd test\web-css-take-it-further - modified in vwd\App_Data\ASPNETDB.MDF";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

</

connectionStrings>

<

system.web>

<

roleManagerenabled="true" />

<

authenticationmode="Forms" >

<

formname=".ASPXAUTH"loginUrl="Login.aspx"defaultUrl="threecolumn.aspx"protection="All"timeout="20160"path="/"requireSSL="false"slidingExpiration="true"cookieless="UseDeviceProfile"domain=""enableCrossAppRedirects="false">

</

form>

</

authentication>

<

compilationdebug="true"/>

<

anonymousIdentificationenabled="true" />

<

profile>

<

properties>

<

addname="PostalCode"type="System.String"allowAnonymous="true" />

</

properties>

</

profile>

</

system.web>

<

system.net>

<

mailSettings>

<

smtpfrom="andy.hillyard@.ntlworld.com">

<

networkhost="smtp.ntlworld.com"password=""userName="" />

</

smtp>

</

mailSettings>

</

system.net>

</

configuration>

i

am getting this error message at run time:|||

This is my web config file now, what do i put in the form name and path fields?:

<?

xmlversion="1.0"?>

<

configurationxmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

<

connectionStrings>

<

addname="ASPNETDBConnectionString"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Inetpub\wwwroot\vwd test\web-css-take-it-further - modified in vwd\App_Data\ASPNETDB.MDF";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

<

addname="ASPNETDBConnectionString2"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Inetpub\wwwroot\vwd test\web-css-take-it-further - modified in vwd\App_Data\ASPNETDB.MDF";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

<

addname="ASPNETDBConnectionString3"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Inetpub\wwwroot\vwd test\web-css-take-it-further - modified in vwd\App_Data\ASPNETDB.MDF";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

</

connectionStrings>

<

system.web>

<

roleManagerenabled="true" />

<

authenticationmode="Forms" >

<

formname=".ASPXAUTH"loginUrl="Login.aspx"defaultUrl="threecolumn.aspx"protection="All"timeout="20160"path="/"requireSSL="false"slidingExpiration="true"cookieless="UseDeviceProfile"domain=""enableCrossAppRedirects="false">

</

form>

</

authentication>

<

compilationdebug="true"/>

<

anonymousIdentificationenabled="true" />

<

profile>

<

properties>

<

addname="PostalCode"type="System.String"allowAnonymous="true" />

</

properties>

</

profile>

</

system.web>

<

system.net>

<

mailSettings>

<

smtpfrom="andy.hillyard@.ntlworld.com">

<

networkhost="smtp.ntlworld.com"password=""userName="" />

</

smtp>

</

mailSettings>

</

system.net>

</

configuration>

i

am|||

This is my web config file now, what do i put in the form name and path fields?:

<?

xmlversion="1.0"?>

<

configurationxmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

<

connectionStrings>

<

addname="ASPNETDBConnectionString"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Inetpub\wwwroot\vwd test\web-css-take-it-further - modified in vwd\App_Data\ASPNETDB.MDF";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

<

addname="ASPNETDBConnectionString2"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Inetpub\wwwroot\vwd test\web-css-take-it-further - modified in vwd\App_Data\ASPNETDB.MDF";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

<

addname="ASPNETDBConnectionString3"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Inetpub\wwwroot\vwd test\web-css-take-it-further - modified in vwd\App_Data\ASPNETDB.MDF";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

</

connectionStrings>

<

system.web>

<

roleManagerenabled="true" />

<

authenticationmode="Forms" >

<

formname=".ASPXAUTH"loginUrl="Login.aspx"defaultUrl="threecolumn.aspx"protection="All"timeout="20160"path="/"requireSSL="false"slidingExpiration="true"cookieless="UseDeviceProfile"domain=""enableCrossAppRedirects="false">

</

form>

</

authentication>

<

compilationdebug="true"/>

<

anonymousIdentificationenabled="true" />

<

profile>

<

properties>

<

addname="PostalCode"type="System.String"allowAnonymous="true" />

</

properties>

</

profile>

</

system.web>

<

system.net>

<

mailSettings>

<

smtpfrom="andy.hillyard@.ntlworld.com">

<

networkhost="smtp.ntlworld.com"password=""userName="" />

</

smtp>

</

mailSettings>

</

system.net>

</

configuration>

i

am getting this error message at run time:

Server Error in '/' Application.

Configuration Error

Description:An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message:Unrecognized element 'form'.

Source Error:

Line 12: <roleManager enabled="true" />Line 13: <authentication mode="Forms" >Line 14: <form name=".ASPXAUTH" loginUrl="Login.aspx" defaultUrl="threecolumn.aspx" protection="All" timeout="20160" path="/" requireSSL="false" slidingExpiration="true" cookieless="UseDeviceProfile" domain="" enableCrossAppRedirects="false">Line 15: </form>Line 16: </authentication>

|||

This is my web config file now, what do i put in the form name and path fields?:

<?

xmlversion="1.0"?>

<

configurationxmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

<

connectionStrings>

<

addname="ASPNETDBConnectionString"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Inetpub\wwwroot\vwd test\web-css-take-it-further - modified in vwd\App_Data\ASPNETDB.MDF";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

<

addname="ASPNETDBConnectionString2"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Inetpub\wwwroot\vwd test\web-css-take-it-further - modified in vwd\App_Data\ASPNETDB.MDF";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

<

addname="ASPNETDBConnectionString3"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Inetpub\wwwroot\vwd test\web-css-take-it-further - modified in vwd\App_Data\ASPNETDB.MDF";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

</

connectionStrings>

<

system.web>

<

roleManagerenabled="true" />

<

authenticationmode="Forms" >

<

formname=".ASPXAUTH"loginUrl="Login.aspx"defaultUrl="threecolumn.aspx"protection="All"timeout="20160"path="/"requireSSL="false"slidingExpiration="true"cookieless="UseDeviceProfile"domain=""enableCrossAppRedirects="false">

</

form>

</

authentication>

<

compilationdebug="true"/>

<

anonymousIdentificationenabled="true" />

<

profile>

<

properties>

<

addname="PostalCode"type="System.String"allowAnonymous="true" />

</

properties>

</

profile>

</

system.web>

<

system.net>

<

mailSettings>

<

smtpfrom="andy.hillyard@.ntlworld.com">

<

networkhost="smtp.ntlworld.com"password=""userName="" />

</

smtp>

</

mailSettings>

</

system.net>

</

configuration>|||

This is my web config file now, what do i put in the form name and path fields?:

<?

xmlversion="1.0"?>

<

configurationxmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

<

connectionStrings>

<

addname="ASPNETDBConnectionString"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Inetpub\wwwroot\vwd test\web-css-take-it-further - modified in vwd\App_Data\ASPNETDB.MDF";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

<

addname="ASPNETDBConnectionString2"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Inetpub\wwwroot\vwd test\web-css-take-it-further - modified in vwd\App_Data\ASPNETDB.MDF";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

<

addname="ASPNETDBConnectionString3"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Inetpub\wwwroot\vwd test\web-css-take-it-further - modified in vwd\App_Data\ASPNETDB.MDF";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

</

connectionStrings>

<

system.web>

<

roleManagerenabled="true" />

<

authenticationmode="Forms" >

<

formname=".ASPXAUTH"loginUrl="Login.aspx"defaultUrl="threecolumn.aspx"protection="All"timeout="20160"path="/"requireSSL="false"slidingExpiration="true"cookieless="UseDeviceProfile"domain=""enableCrossAppRedirects="false">

</

form>

</

authentication>

<

compilationdebug="true"/>

<

anonymousIdentificationenabled="true" />

<

profile>

<

properties>

<

addname="PostalCode"type="System.String"allowAnonymous="true" />

</

properties>

</

profile>

</

system.web>

<

system.net>

<

mailSettings>

<

smtpfrom="andy.hillyard@.ntlworld.com">

<

networkhost="smtp.ntlworld.com"password=""userName="" />

</

smtp>

</

mailSettings>

</

system.net>

</

configuration>

i

am getting this error message at run time:

Server Error in '/' Application.

Configuration Error

Description:An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message:Unrecognized element 'form'.

Source Error:

Line 12: <roleManager enabled="true" />Line 13: <authentication mode="Forms" >Line 14: <form name=".ASPXAUTH" loginUrl="Login.aspx" defaultUrl="threecolumn.aspx" protection="All" timeout="20160" path="/" requireSSL="false" slidingExpiration="true" cookieless="UseDeviceProfile" domain="" enableCrossAppRedirects="false">Line 15: </form>Line 16: </authentication>

|||Very strange, are you using .net 2.0 or 1.1? Are you testing your project using the internal VS2005 web server or IIS?|||visual web developer express, iis|||

Ok,Its possible your web application in IIS isn't set to asp.net 2.0.

In IIS, if you right click on the site and choose properties, you should see an ASP.NET tab. You should make sure its set to ASP.NET version 2.0.50727

If you're using IIS on your local box then that should be it. If you're using IIS on a web server, then you might have multiple web applications. If you "do" have multiple web applications on an external web server inside of IIS, you have to make sure that your 2.0 apps aren't sharing the same Application_pool with a 1.1 application. I can give you more info once I get a better handle on what you're doing.

Thanks

|||

yes i am using the latest version of asp.net.

using iis web server on my local box - http//localhost.

On your last point, this may be the case, as i have created more than one virtual directory in vwd.

|||

ACK! I apologize, I didn't notice at first that you left off the S from forms. its meant to be.

<

formsname=".ASPXAUTH"loginUrl="login.aspx"defaultUrl="default.aspx"protection="All"timeout="20160"path="/"requireSSL="false"slidingExpiration="true"cookieless="UseDeviceProfile"domain=""enableCrossAppRedirects="false">

<

credentialspasswordFormat="SHA1"/>

</

forms>

I think it was one of those things where it was "so" close to being right I couldn't immediately notice the problem. Hopefully that helps.

No comments:

Post a Comment