473,406 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Problems with WebParts

I seem to be having a problem using web parts after the beta 2 release. Any
time I try to have the WebPartManager on any page, I get the exception listed
below. I've gone through the steps listed below and have gone as far as
given EVERYONE full control of the App_Data folder. I am using the default
settings (which I assume is the Cassini web server), so I believe it is a
user permissions problem. Furthermore, if I publish the site under IIS, it
works fine. What am I missing and how can I make sure that my user has
dbcreator privileges for SQLExpress?

Thanks in advance.
Exception below

************************************************** ************************************************** ********************
Failed to generate a user instance of SQL Server due to a failure in
starting the process for the user instance. 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.

SQLExpress database file auto-creation error:
The connection string specifies a local SQL Server Express instance using a
database location within the applications App_Data directory. The provider
attempted to automatically create the application services database because
the provider determined that the database does not exist. The following
configuration requirements are necessary to successfully check for existence
of the application services database and automatically create the application
services database:
If the applications App_Data directory does not already exist, the web
server account must have read and write access to the applications directory.
This is necessary because the web server account will automatically create
the App_Data directory if it does not already exist.
If the applications App_Data directory already exists, the web server
account only requires read access to the applications App_Data directory.
This is necessary because the web server account will attempt to verify that
the SQL Server Express database already exists within the applications
App_Data directory. Note that revoking read access on the App_Data directory
from the web server account will prevent the provider from correctly
determining if the SQL Server Express database already exists. This will
cause an error when SQL Server Express attempts to create a duplicate of an
already existing database.
SQL Server Express must be installed on the machine.
If the application services database does not already exist, the SQL Server
Express service account must have read and write access to the applications
App_Data directory. This is necessary because the SQL Server Express service
account will create the application services database.
The web server account used to connect to SQL Server Express must have
rights to create a new database.
When using the local web server(Cassini) installed with Visual Studio, the
logged-in user needs the dbcreator privilege in the appropriate SQL Server
Express instance.
When using IIS, the process account needs the dbcreator privilege in the
appropriate SQL Server Express instance. Only consider granting a process
account dbcreator privilege on secure development machines. Do not grant the
dbcreator privilege on production machines without fully investigating and
understanding the security ramifications of running a production web server
with the dbcreator privilege. The process account requiring dbcreator
privilege varies depending on operating system platform and ASP.NET
configuration settings:
For IIS5, and IIS6 running in IIS5 isolation mode, the default web server
account is the local ASPNET machine account.
For IIS6 native mode, the default web server account is NETWORK SERVICE.
If application impersonation is enabled, then the application impersonation
account requires the dbcreator privilege.
If an explicit account was specified for the web server process (either in
the <processModel> element for IIS5 and IIS5 isolation mode, or the
application pool account on IIS6), then the explicit account requires the
dbcreator privilege.

************************************************** *********
************************************************** *********
end exception (minus the stack trace)
Nov 19 '05 #1
1 2190
I'm not WebParts expert - just getting it all straight in my head now, but I
have seen this problem a couple of times and know what it is about.

Firstly you must have the aspnetdb personalization installed - this can be
done with the aspnet_regsql.exe tool that lives in the Framework 2.0
directory (%systemroot%\Microsoft.Net\v2.0.50215 on my machine), there are
several good artciles on using this and also runing at prompt with /? will
list what you can do also).

When that is installed you need to make sure that the connection strings
being used are correct. By default these are inherited from the web.config
in the CONFIG folder of the framework (above folder). It expects a
connectionstring names "LocalSqlServer" which uses integrated security to get
to a database called aspnetdb.

If this connection fails it tries to create the data itself I believe.

What I have done to sort this out is to add the providers to my web.config
so that they override the framework settings (web.config in CONFIG folder),
making sure theat they use a valid connection string. Once this is in place
you should be good to go and not see this message again - I think the error
message it is a little misleading.

Here's a copy of a web.config that works for me - you'll need to update the
connection string of course (this is with Visual Studio 2005 Beta2).

Note the providers under Membership, RoleManager and WebParts sections - I
am guessing you do not have one for webparts at the moment and this is the
cause of your problem.
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings />
<connectionStrings>
<clear />
<add name="aspnetdbConnectionString"
connectionString="server=(local);database=aspnetdb ;uid=sa;pwd=sa"
providerName="System.Data.SqlClient" />

</connectionStrings>
<system.web>
<membership>
<providers>
<remove name="AspNetSqlMembershipProvider" />
<add connectionStringName="aspnetdbConnectionString"
name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</membership>
<roleManager enabled="true">
<providers>
<remove name="AspNetSqlRoleProvider" />
<add connectionStringName="aspnetdbConnectionString" applicationName="/"
name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider,
System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</roleManager>
<authentication mode="Forms" />
<authorization>
<deny users="?" />
</authorization>
<compilation debug="true" defaultLanguage="c#" />
<webParts enableExport="true">
<personalization>
<providers>
<clear />
<add connectionStringName="aspnetdbConnectionString"
name="AspNetSqlPersonalizationProvider"
type="System.Web.UI.WebControls.WebParts.SqlPerson alizationProvider,
System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" />
</providers>

<authorization>
<deny users="*" verbs="enterSharedScope" />
<allow users="*" verbs="modifyState" />
</authorization>
</personalization>

<transformers>
<add name="RowToFieldTransformer"
type="System.Web.UI.WebControls.WebParts.RowToFiel dTransformer" />
<add name="RowToParametersTransformer"
type="System.Web.UI.WebControls.WebParts.RowToPara metersTransformer" />
</transformers>
</webParts>

</system.web>
</configuration>
--------------------------
Shaun Venus

emailid: sunevnuahs
domain: hotmail.com
--------------------------
"Astera" wrote:
I seem to be having a problem using web parts after the beta 2 release. Any
time I try to have the WebPartManager on any page, I get the exception listed
below. I've gone through the steps listed below and have gone as far as
given EVERYONE full control of the App_Data folder. I am using the default
settings (which I assume is the Cassini web server), so I believe it is a
user permissions problem. Furthermore, if I publish the site under IIS, it
works fine. What am I missing and how can I make sure that my user has
dbcreator privileges for SQLExpress?

Thanks in advance.
Exception below

************************************************** ************************************************** ********************
Failed to generate a user instance of SQL Server due to a failure in
starting the process for the user instance. 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.

SQLExpress database file auto-creation error:
The connection string specifies a local SQL Server Express instance using a
database location within the applications App_Data directory. The provider
attempted to automatically create the application services database because
the provider determined that the database does not exist. The following
configuration requirements are necessary to successfully check for existence
of the application services database and automatically create the application
services database:
If the applications App_Data directory does not already exist, the web
server account must have read and write access to the applications directory.
This is necessary because the web server account will automatically create
the App_Data directory if it does not already exist.
If the applications App_Data directory already exists, the web server
account only requires read access to the applications App_Data directory.
This is necessary because the web server account will attempt to verify that
the SQL Server Express database already exists within the applications
App_Data directory. Note that revoking read access on the App_Data directory
from the web server account will prevent the provider from correctly
determining if the SQL Server Express database already exists. This will
cause an error when SQL Server Express attempts to create a duplicate of an
already existing database.
SQL Server Express must be installed on the machine.
If the application services database does not already exist, the SQL Server
Express service account must have read and write access to the applications
App_Data directory. This is necessary because the SQL Server Express service
account will create the application services database.
The web server account used to connect to SQL Server Express must have
rights to create a new database.
When using the local web server(Cassini) installed with Visual Studio, the
logged-in user needs the dbcreator privilege in the appropriate SQL Server
Express instance.
When using IIS, the process account needs the dbcreator privilege in the
appropriate SQL Server Express instance. Only consider granting a process
account dbcreator privilege on secure development machines. Do not grant the
dbcreator privilege on production machines without fully investigating and
understanding the security ramifications of running a production web server
with the dbcreator privilege. The process account requiring dbcreator
privilege varies depending on operating system platform and ASP.NET
configuration settings:
For IIS5, and IIS6 running in IIS5 isolation mode, the default web server
account is the local ASPNET machine account.
For IIS6 native mode, the default web server account is NETWORK SERVICE.
If application impersonation is enabled, then the application impersonation
account requires the dbcreator privilege.
If an explicit account was specified for the web server process (either in
the <processModel> element for IIS5 and IIS5 isolation mode, or the
application pool account on IIS6), then the explicit account requires the
dbcreator privilege.

************************************************** *********
************************************************** *********
end exception (minus the stack trace)

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Barbara Alderton | last post by:
I am working with SharePoint 2003. I am using (using C#) an existing webpart as a child control (server control). I need to access/manipulate the HTML that the control outputs prior to rendering...
2
by: fa | last post by:
Hi there, I have created an .aspx file using Asp.Net (2.0) C#, which contains two webparts. How can i pass data/parameter between these two, so that when user chooses an item from WebPart1, I can...
1
by: ryan.mclean | last post by:
Hi all, I have a strange problem and I think it may be something in my web.config . . . but I'm not sure. I have an application that uses webpart (not sharepoint), but the nifty new .net...
0
by: needin4mation | last post by:
never used WebParts and had a question. If I have three webparts on my asp.net form. And I use Atlas with them, do the different webparts act independently or will running them in succession...
3
by: Bart Van Hemelen | last post by:
I'm working on a project where the user of a site will receive custom content, depending on a set of parameters. The content will all be contained in UserControls (.ascx), that will be used as...
6
by: brianroisentul | last post by:
Hello, I'd like to know which dll I have to reference when I use the System.Web.UI.WebControls.Webparts namespace. Thanks, Brian
3
by: Q. John Chen | last post by:
I have an INTRAnet site that need to add some content management feature. And I thought that I can use the WebParts. Since this is an internal site, I use Windows authentication so the use don't...
1
by: sales | last post by:
How can I turn a webpart of for all users in the default mode and on Reset personalation. I have a portal page in ASP.net and have 7 webparts displayed, I only want 6 displayed which the option to...
3
by: clintonG | last post by:
Why don't we see more WebParts being used on the web? SharePoint gets all the fun? And what are the prevailing opinions be they what they may about the use of WebParts rather than WPF when the...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.