473,780 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 programmaticall y 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 1310
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 programmaticall y 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:

<connectionStri ngs>
<remove name="LocalSqlS erver"/>
<add name="LocalSqlS erver"
connectionStrin g="[Your connection string here]"
providerName="S ystem.Data.SqlC lient" />
</connectionStrin gs>
Kevin

Aug 22 '06 #3

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

Similar topics

2
1861
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 txtItemCode_KeyPress(ByVal sender As Object, ByVal e A System.Windows.Forms.KeyPressEventArgs) Handles txtItemCode.KeyPress Dim db As New OleDbCommand _ ("SELECT * FROM " & "WHERE ItemCode ='" txtItemCode.Text & "'", dc) dc.Open()
10
2725
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 VS, however, when I change to release and put it out on the web it fails giving me the following error message The underlying connection was closed. Could not establish a trust relationship with the remote server.
6
2230
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 class would have CurrentUser property that would hold customer class in session and that was fine for all my situations. Now ASP.NET 2.0 came and we have Profile property for pages that could be extended with configuration to have custom...
9
3225
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 CDOmail. I don't want to use the Outlook reference because outlook prompts each time program access it and I have found a way to disable that. Can I use webmail with exchange? Thanks
0
4356
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 Src="WebPartPageMenu.ascx" TagName="WebPartPageMenu" TagPrefix="uc1" %> <html> <head id="Head1" runat="server"> <title>Web Part Page</title>
1
1900
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 setup on the site through the admin interface. So I yanked it out of the application since it did not work. Now everytime I load the site after changing the application I get this error message. If I simply refresh the page, everything works...
3
1968
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 so I did:
2
1413
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 user. But I want to change the profile of another user. Anyway, I am using:
7
7490
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 connection for terminal server setup. Any help is greatly appreciated.
0
9636
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10306
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10075
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9931
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6727
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.