473,394 Members | 1,701 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,394 software developers and data experts.

SQL Connection Error on Profile.Save()

Hi folks,

I am trying to use the new User Profile functionality in ASP.Net 2, and on
initial impression, it looked simple enough to use.

But I seem to be getting in a bit of a mess as to what is going on
internally, making it difficult for me to trace the SQL connectivity errors I
seem to be getting suddenly.

I have my own SQL Express database, on which I've run aspNet_regsql utility
to create the user membership tables.

The ASP.Net Configuration tools connects fine to my database, and allows me
to create users and roles without a problem.

I have also implemented some custom code which programmatically creates
users and associates them with roles.

Again, all worked ok, and to plan.

However, from time to time, code which has already been tested successfully,
starts generating the following SQL error, on Profile.Save().

"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. "

Bemused, I checked the web.config against SourceSafe to see if any changes
had snook in - which they hadn't.

My database seemed ok.

Then I spotted ASPNETDB in the App_Data folder. I hadn't created this
database - it seems to be have been created by Visual Studio itself.

Can anyone explain what this database is for?

My understanding is that it is used to store users/memberships in the event
that no other database is specified, but this is not so in my case.

The last time I had this problem a couple of days ago, I did various
combinations of deleting the ASPNETDB files, attempted tweaking Web.Config,
restarting Visual Studio .. in fact ANYTHING to try and get things working
again, in complete bemusement about what had changed. I don't know what
combination of things did the trick, but I eventually got the app running
again. Only to encounter the same problem a couple of days later.

Anyway, in short, can anyone give me any advice on how to get the ASPNETDB
database (and any of its dependencies) OUT of my solution, and force my OWN
database to be used to users/membership/etc.? ... And have it STAY THAT WAY?!!
ANY advice will be gratefully received!

JoeFusion

Aug 22 '06 #1
2 1298
the aspnetdb dealie is because that's the default provider database defined
in machine.config. To override this you need to specifically add the <remove
name=...
semantics in the web.config. I don't have the exact syntax handy but that
should get you started on the right path. After you Clear or Remove the
default provider, then you can add your own custom provider connection string.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"JoeFusion" wrote:
Hi folks,

I am trying to use the new User Profile functionality in ASP.Net 2, and on
initial impression, it looked simple enough to use.

But I seem to be getting in a bit of a mess as to what is going on
internally, making it difficult for me to trace the SQL connectivity errors I
seem to be getting suddenly.

I have my own SQL Express database, on which I've run aspNet_regsql utility
to create the user membership tables.

The ASP.Net Configuration tools connects fine to my database, and allows me
to create users and roles without a problem.

I have also implemented some custom code which programmatically creates
users and associates them with roles.

Again, all worked ok, and to plan.

However, from time to time, code which has already been tested successfully,
starts generating the following SQL error, on Profile.Save().

"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. "

Bemused, I checked the web.config against SourceSafe to see if any changes
had snook in - which they hadn't.

My database seemed ok.

Then I spotted ASPNETDB in the App_Data folder. I hadn't created this
database - it seems to be have been created by Visual Studio itself.

Can anyone explain what this database is for?

My understanding is that it is used to store users/memberships in the event
that no other database is specified, but this is not so in my case.

The last time I had this problem a couple of days ago, I did various
combinations of deleting the ASPNETDB files, attempted tweaking Web.Config,
restarting Visual Studio .. in fact ANYTHING to try and get things working
again, in complete bemusement about what had changed. I don't know what
combination of things did the trick, but I eventually got the app running
again. Only to encounter the same problem a couple of days later.

Anyway, in short, can anyone give me any advice on how to get the ASPNETDB
database (and any of its dependencies) OUT of my solution, and force my OWN
database to be used to users/membership/etc.? ... And have it STAY THAT WAY?!!
ANY advice will be gratefully received!

JoeFusion
Aug 22 '06 #2
The DB in App_Data is the database created by the default provider. The
connection string for this is called LocalSqlServer and is defined in
machine.config. Probably the easiest way to fix this is to remove this
definition and re-create it in your apps web.config. Something like:

<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer"
connectionString="[Your connection string here]"
providerName="System.Data.SqlClient" />
</connectionStrings>
Kevin

Aug 22 '06 #3

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

Similar topics

2
by: lea | last post by:
i create few textboxes, if i enter data in txtItemCode, the rest txtbo will display data that read from database. show below. ========================================================== Private Su...
10
by: Brian Conway | last post by:
I have no idea what is going on. I have a Login screen where someone types in their login information and this populates a datagrid based off of the login. Works great in debug and test through...
6
by: Shimon Sim | last post by:
Hi I am working on application that need to hold custom user information - Last and first name, email, some other domain related information. I used to create Base class for all my pages. The base...
9
by: B-Dog | last post by:
I've built a small app that sends mail through our ISP's SMTP server but when I try to send through my local exchange server I get CDO error. Does webmail use SMTP or does it strictly rely on...
0
by: tony dong | last post by:
Hi there I use vs.net 2005 with standard sql 2005 under machine\sql2005 for instant when I create webpart, the code get from quickstart as follow: <%@ Page Language="C#" %> <%@ Register...
1
by: Chris Love | last post by:
I have already asked this, but no one seems to know the answer. Here is the timeline. I wanted to use the membership/roles functionality in a site. I got all sorts of errors trying to get this...
3
by: shapper | last post by:
Hello, In my Page's VB.NET code I am changing the value of the Profile property NAME. Profile.Name = tbName.Text However, I need to change this property value from a class in my App_Code...
2
by: shapper | last post by:
Hello, I have an ASP.NET page and in its runtime code I am trying to get an user profile, change it and save it. It works if I use Profile, which is the profile for the current authenticated...
7
by: Bill Nguyen | last post by:
I have this connection string using ODBC DSN Dim FactorJaco As String = "dsn=jaco;catalog=factor;uid=user;pwd=passord" This requires an ODBC DSN (jaco) at every client PC. I need to use DSN-less...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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.