473,700 Members | 2,424 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASPNETDB.MDF when no SQLExpress, only SQL Server 2005?

I have only SQL Server 2005 installed on my PC. And I tried to add the
following rows in web.config to use SQL Server 2005 instead of Express:

<connectionStri ngs>
<clear />
<add name="LocalSqlS erver" connectionStrin g="Data
Source=.\SQL200 5;AttachDbFilen ame=|DataDirect ory|\ASPNETDB.M DF;user
instance=true;I ntegrated Security=True;I nitial Catalog=ASPNETD B;"
providerName="S ystem.Data.SqlC lient" />
</connectionStrin gs>

However, I still get error:

The user instance login flag is not supported on this version of SQL Server.
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.

Exception Details: System.Data.Sql Client.SqlExcep tion: The user instance
login flag is not supported on this version of SQL Server. The connection
will be closed.

And double click the ASPNETDB.MDF on solution explorer will get error
message: Connections to SQL Server files (*.mdf) require SQL Server Express
2005 to function properly. Please verify the installation of the component
.....

I need to deploy the application to my web host server and neither do they
have Sql Server express.
How to fix the problem.
TIA.

Jun 19 '06 #1
8 6708
nick,
The exception message is exactly what it says - SQL Server 2005 does not
support the "user instance" directive in the connection string as does SQL
Express. The database has to be a a real instance and it has to be attached.
Here's a working example:

<connectionStri ngs>
<remove name="LocalSqlS erver" />
<add name="LocalSqlS erver"
connectionStrin g="server=local host;database=A rticles;uid=sa; pwd="
providerName="S ystem.Data.SqlC lient" />
</connectionStrin gs>
Also, this article may be helpful with more info:

http://www.eggheadcafe.com/articles/20060529.asp

Peter

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


"nick" wrote:
I have only SQL Server 2005 installed on my PC. And I tried to add the
following rows in web.config to use SQL Server 2005 instead of Express:

<connectionStri ngs>
<clear />
<add name="LocalSqlS erver" connectionStrin g="Data
Source=.\SQL200 5;AttachDbFilen ame=|DataDirect ory|\ASPNETDB.M DF;user
instance=true;I ntegrated Security=True;I nitial Catalog=ASPNETD B;"
providerName="S ystem.Data.SqlC lient" />
</connectionStrin gs>

However, I still get error:

The user instance login flag is not supported on this version of SQL Server.
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.

Exception Details: System.Data.Sql Client.SqlExcep tion: The user instance
login flag is not supported on this version of SQL Server. The connection
will be closed.

And double click the ASPNETDB.MDF on solution explorer will get error
message: Connections to SQL Server files (*.mdf) require SQL Server Express
2005 to function properly. Please verify the installation of the component
....

I need to deploy the application to my web host server and neither do they
have Sql Server express.
How to fix the problem.
TIA.

Jun 19 '06 #2
SQL server is a real pain for webhost environments.

You will need to upload the mdf file and have your webhost attach it to the sql server.

Most won't do this.

In which case you will need to recreate the database into the database which is available to the hosted domain if you have signed up
for that service. Typically expensive, and a very clumsy process.
good luck.
"nick" <ni**@discussio ns.microsoft.co m> wrote in message news:56******** *************** ***********@mic rosoft.com...
I have only SQL Server 2005 installed on my PC. And I tried to add the
following rows in web.config to use SQL Server 2005 instead of Express:

<connectionStri ngs>
<clear />
<add name="LocalSqlS erver" connectionStrin g="Data
Source=.\SQL200 5;AttachDbFilen ame=|DataDirect ory|\ASPNETDB.M DF;user
instance=true;I ntegrated Security=True;I nitial Catalog=ASPNETD B;"
providerName="S ystem.Data.SqlC lient" />
</connectionStrin gs>

However, I still get error:

The user instance login flag is not supported on this version of SQL Server.
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.

Exception Details: System.Data.Sql Client.SqlExcep tion: The user instance
login flag is not supported on this version of SQL Server. The connection
will be closed.

And double click the ASPNETDB.MDF on solution explorer will get error
message: Connections to SQL Server files (*.mdf) require SQL Server Express
2005 to function properly. Please verify the installation of the component
....

I need to deploy the application to my web host server and neither do they
have Sql Server express.
How to fix the problem.
TIA.

Jun 19 '06 #3

Jon Paal wrote:
SQL server is a real pain for webhost environments.

You will need to upload the mdf file and have your webhost attach it to the sql server.

Most won't do this.

In which case you will need to recreate the database into the database which is available to the hosted domain if you have signed up
for that service. Typically expensive, and a very clumsy process.
good luck.

Well, since SQL Express and the full version can run side by side it
shouldn't really be an issue, the problem here is that most hosting
companies havent really understood what SQL Server 2005 Express Edition
is all about and wont install it.

I have my personal website hosted at godaddy and although they offer
20M SQL Server 2000 space they completely refused my request to install
SQL Server 2005 Express Edition.

They just don't get it and they have no interest in learning about it.

PL.

Jun 19 '06 #4
I agree. It is a huge problem.

There really needs to be an acceptable, file-based database solution.

Something that can be managed remotely and deployed independently like any other file.


"pblse2" <lu***********@ gmail.com> wrote in message news:11******** *************@g 10g2000cwb.goog legroups.com...

Jon Paal wrote:
SQL server is a real pain for webhost environments.

You will need to upload the mdf file and have your webhost attach it to the sql server.

Most won't do this.

In which case you will need to recreate the database into the database which is available to the hosted domain if you have signed
up
for that service. Typically expensive, and a very clumsy process.
good luck.

Well, since SQL Express and the full version can run side by side it
shouldn't really be an issue, the problem here is that most hosting
companies havent really understood what SQL Server 2005 Express Edition
is all about and wont install it.

I have my personal website hosted at godaddy and although they offer
20M SQL Server 2000 space they completely refused my request to install
SQL Server 2005 Express Edition.

They just don't get it and they have no interest in learning about it.

PL.

Jun 19 '06 #5
Jon,
You do not need to "upload the MDF file" and attach it. YOu can enable any
database with this code:

Management.SqlS ervices.Install ("server", "USERNAME", "PASSWORD",
"databasena me", SqlFeatures.All )
That's in the System.Web namespace, and it can be run from a web page.

I agree that it's too bad MS hasn't really promoted this fact, given that so
many people run ASP.NET 2.0 web sites on hosted environments where they have
no access to ASPNET_REGSQL.
Peter

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


"Jon Paal" wrote:
SQL server is a real pain for webhost environments.

You will need to upload the mdf file and have your webhost attach it to the sql server.

Most won't do this.

In which case you will need to recreate the database into the database which is available to the hosted domain if you have signed up
for that service. Typically expensive, and a very clumsy process.
good luck.
"nick" <ni**@discussio ns.microsoft.co m> wrote in message news:56******** *************** ***********@mic rosoft.com...
I have only SQL Server 2005 installed on my PC. And I tried to add the
following rows in web.config to use SQL Server 2005 instead of Express:

<connectionStri ngs>
<clear />
<add name="LocalSqlS erver" connectionStrin g="Data
Source=.\SQL200 5;AttachDbFilen ame=|DataDirect ory|\ASPNETDB.M DF;user
instance=true;I ntegrated Security=True;I nitial Catalog=ASPNETD B;"
providerName="S ystem.Data.SqlC lient" />
</connectionStrin gs>

However, I still get error:

The user instance login flag is not supported on this version of SQL Server.
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.

Exception Details: System.Data.Sql Client.SqlExcep tion: The user instance
login flag is not supported on this version of SQL Server. The connection
will be closed.

And double click the ASPNETDB.MDF on solution explorer will get error
message: Connections to SQL Server files (*.mdf) require SQL Server Express
2005 to function properly. Please verify the installation of the component
....

I need to deploy the application to my web host server and neither do they
have Sql Server express.
How to fix the problem.
TIA.


Jun 19 '06 #6
you lost me on this one.

Assuming someone has procured some SQL server space from their webhost, are you saying this code will transfer all local tables,
stored procedures, security etc. over to the webhost sql server without their participation ?


"Peter Bromberg [C# MVP]" <pb*******@yaho o.nospammin.com > wrote in message
news:92******** *************** ***********@mic rosoft.com...
Jon,
You do not need to "upload the MDF file" and attach it. YOu can enable any
database with this code:

Management.SqlS ervices.Install ("server", "USERNAME", "PASSWORD",
"databasena me", SqlFeatures.All )
That's in the System.Web namespace, and it can be run from a web page.

I agree that it's too bad MS hasn't really promoted this fact, given that so
many people run ASP.NET 2.0 web sites on hosted environments where they have
no access to ASPNET_REGSQL.
Peter

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


"Jon Paal" wrote:
SQL server is a real pain for webhost environments.

You will need to upload the mdf file and have your webhost attach it to the sql server.

Most won't do this.

In which case you will need to recreate the database into the database which is available to the hosted domain if you have signed
up
for that service. Typically expensive, and a very clumsy process.
good luck.
"nick" <ni**@discussio ns.microsoft.co m> wrote in message news:56******** *************** ***********@mic rosoft.com...
>I have only SQL Server 2005 installed on my PC. And I tried to add the
> following rows in web.config to use SQL Server 2005 instead of Express:
>
> <connectionStri ngs>
> <clear />
> <add name="LocalSqlS erver" connectionStrin g="Data
> Source=.\SQL200 5;AttachDbFilen ame=|DataDirect ory|\ASPNETDB.M DF;user
> instance=true;I ntegrated Security=True;I nitial Catalog=ASPNETD B;"
> providerName="S ystem.Data.SqlC lient" />
> </connectionStrin gs>
>
> However, I still get error:
>
> The user instance login flag is not supported on this version of SQL Server.
> 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.
>
> Exception Details: System.Data.Sql Client.SqlExcep tion: The user instance
> login flag is not supported on this version of SQL Server. The connection
> will be closed.
>
> And double click the ASPNETDB.MDF on solution explorer will get error
> message: Connections to SQL Server files (*.mdf) require SQL Server Express
> 2005 to function properly. Please verify the installation of the component
> ....
>
> I need to deploy the application to my web host server and neither do they
> have Sql Server express.
> How to fix the problem.
> TIA.
>


Jun 19 '06 #7
For enabling a Sql Server 2000 or 2005 database for Membership, Roles and
Profiles, that's what this method call will do. It creates all the tables,
views, and stored procedures to begin using the Membership, Roles and Profile
providers with the target database. If you then have "stuff" in a local
database that's already set up, you may be able to do insert -selects to
bring it over.

Unfortunately, MS decided not to document the feature very well.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Jon Paal" wrote:
you lost me on this one.

Assuming someone has procured some SQL server space from their webhost, are you saying this code will transfer all local tables,
stored procedures, security etc. over to the webhost sql server without their participation ?


"Peter Bromberg [C# MVP]" <pb*******@yaho o.nospammin.com > wrote in message
news:92******** *************** ***********@mic rosoft.com...
Jon,
You do not need to "upload the MDF file" and attach it. YOu can enable any
database with this code:

Management.SqlS ervices.Install ("server", "USERNAME", "PASSWORD",
"databasena me", SqlFeatures.All )
That's in the System.Web namespace, and it can be run from a web page.

I agree that it's too bad MS hasn't really promoted this fact, given that so
many people run ASP.NET 2.0 web sites on hosted environments where they have
no access to ASPNET_REGSQL.
Peter

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


"Jon Paal" wrote:
SQL server is a real pain for webhost environments.

You will need to upload the mdf file and have your webhost attach it to the sql server.

Most won't do this.

In which case you will need to recreate the database into the database which is available to the hosted domain if you have signed
up
for that service. Typically expensive, and a very clumsy process.
good luck.
"nick" <ni**@discussio ns.microsoft.co m> wrote in message news:56******** *************** ***********@mic rosoft.com...
>I have only SQL Server 2005 installed on my PC. And I tried to add the
> following rows in web.config to use SQL Server 2005 instead of Express:
>
> <connectionStri ngs>
> <clear />
> <add name="LocalSqlS erver" connectionStrin g="Data
> Source=.\SQL200 5;AttachDbFilen ame=|DataDirect ory|\ASPNETDB.M DF;user
> instance=true;I ntegrated Security=True;I nitial Catalog=ASPNETD B;"
> providerName="S ystem.Data.SqlC lient" />
> </connectionStrin gs>
>
> However, I still get error:
>
> The user instance login flag is not supported on this version of SQL Server.
> 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.
>
> Exception Details: System.Data.Sql Client.SqlExcep tion: The user instance
> login flag is not supported on this version of SQL Server. The connection
> will be closed.
>
> And double click the ASPNETDB.MDF on solution explorer will get error
> message: Connections to SQL Server files (*.mdf) require SQL Server Express
> 2005 to function properly. Please verify the installation of the component
> ....
>
> I need to deploy the application to my web host server and neither do they
> have Sql Server express.
> How to fix the problem.
> TIA.
>


Jun 19 '06 #8
hmmm....

unfortuantely, that still doesn't address the deployment problem .

"Peter Bromberg [C# MVP]" <pb*******@yaho o.nospammin.com > wrote in message
news:C2******** *************** ***********@mic rosoft.com...
For enabling a Sql Server 2000 or 2005 database for Membership, Roles and
Profiles, that's what this method call will do. It creates all the tables,
views, and stored procedures to begin using the Membership, Roles and Profile
providers with the target database. If you then have "stuff" in a local
database that's already set up, you may be able to do insert -selects to
bring it over.

Unfortunately, MS decided not to document the feature very well.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Jon Paal" wrote:
you lost me on this one.

Assuming someone has procured some SQL server space from their webhost, are you saying this code will transfer all local tables,
stored procedures, security etc. over to the webhost sql server without their participation ?


"Peter Bromberg [C# MVP]" <pb*******@yaho o.nospammin.com > wrote in message
news:92******** *************** ***********@mic rosoft.com...
> Jon,
> You do not need to "upload the MDF file" and attach it. YOu can enable any
> database with this code:
>
> Management.SqlS ervices.Install ("server", "USERNAME", "PASSWORD",
> "databasena me", SqlFeatures.All )
>
>
> That's in the System.Web namespace, and it can be run from a web page.
>
> I agree that it's too bad MS hasn't really promoted this fact, given that so
> many people run ASP.NET 2.0 web sites on hosted environments where they have
> no access to ASPNET_REGSQL.
> Peter
>
> --
> Co-founder, Eggheadcafe.com developer portal:
> http://www.eggheadcafe.com
> UnBlog:
> http://petesbloggerama.blogspot.com
>
>
>
>
> "Jon Paal" wrote:
>
>> SQL server is a real pain for webhost environments.
>>
>> You will need to upload the mdf file and have your webhost attach it to the sql server.
>>
>> Most won't do this.
>>
>> In which case you will need to recreate the database into the database which is available to the hosted domain if you have
>> signed
>> up
>> for that service. Typically expensive, and a very clumsy process.
>>
>>
>> good luck.
>>
>>
>> "nick" <ni**@discussio ns.microsoft.co m> wrote in message news:56******** *************** ***********@mic rosoft.com...
>> >I have only SQL Server 2005 installed on my PC. And I tried to add the
>> > following rows in web.config to use SQL Server 2005 instead of Express:
>> >
>> > <connectionStri ngs>
>> > <clear />
>> > <add name="LocalSqlS erver" connectionStrin g="Data
>> > Source=.\SQL200 5;AttachDbFilen ame=|DataDirect ory|\ASPNETDB.M DF;user
>> > instance=true;I ntegrated Security=True;I nitial Catalog=ASPNETD B;"
>> > providerName="S ystem.Data.SqlC lient" />
>> > </connectionStrin gs>
>> >
>> > However, I still get error:
>> >
>> > The user instance login flag is not supported on this version of SQL Server.
>> > 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.
>> >
>> > Exception Details: System.Data.Sql Client.SqlExcep tion: The user instance
>> > login flag is not supported on this version of SQL Server. The connection
>> > will be closed.
>> >
>> > And double click the ASPNETDB.MDF on solution explorer will get error
>> > message: Connections to SQL Server files (*.mdf) require SQL Server Express
>> > 2005 to function properly. Please verify the installation of the component
>> > ....
>> >
>> > I need to deploy the application to my web host server and neither do they
>> > have Sql Server express.
>> > How to fix the problem.
>> > TIA.
>> >
>>
>>
>>


Jun 19 '06 #9

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

Similar topics

4
13305
by: BravesCharm | last post by:
I am trying to connect to SQL Server 2005 Express with Visual C# 2005 Express using this code: static void Main(string args) { SqlConnection conn = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\temp.MDF;User ID=MyUsername;password=MyPass;DATABASE=Test;Integrated Security=False;User Instance=True"); conn.Open();
5
1670
by: George Wei | last post by:
Dear all, I try to use the Login control newly provided in VWD 2005 Express. It is said in the online help that it must have SQL Server 2005 Express installed to save the credential infomation. For SQL Server 2005 Express is still in beta and it provides little management tools, it's difficult to manage/manipulate the database objects. So I want to use SQL Server 2000 instead of it, but I can not find any information to configure the...
4
5244
by: Greg P | last post by:
I know this is a long post, please bear with me. I have been working on this all weekend to no avail although I have done a good amount of research (see most pertinent links that I've looked at below). Please help me get through this!!! I'm having some serious problems attaching a .mdf file and accessing it. I have a WroxUntied.mdf that I want to attach and then run the website that uses it. This is a .mdf file from wrox books. ...
7
2754
by: Greg P | last post by:
I know this is a long post, please bear with me. I have been working on this all weekend to no avail although I have done a good amount of research (see most pertinent links that I've looked at below). Please help me get through this!!! I'm having some serious problems attaching a .mdf file and accessing it. I have a WroxUntied.mdf that I want to attach and then run the website that uses it. This is a .mdf file from wrox books. This file...
3
3160
by: Arpan | last post by:
I recently installed SQL Server 2005 (Management Studio Express) along with SQL Server 2005 Express (Configuration Manager) in my Win2K Pro m/c & use IIS 5.0 to run ASPX projects. I could add my database, named "MyDB", successfully. I am using the Windows Authentication mode to login to SQL Server. My server name is "AD\SQLEXPRESS" where "AD" is the name of my m/c. I could even establish a connection to the server & the database from...
2
8192
by: Marcus | last post by:
(Appologies if this group isn't the best place for this post) Is it possible to use DAO 3.6 to access binary data (varbinary(max)) in Sql Server 2005? I have images and sound in a Sql 2005 DB that I need to retrieve (and write) with DAO (ADO and ADO.Net are not options as this is legacy code that can't be changed). Thx, Marcus
1
2196
by: Steve | last post by:
Hi All I have a windows application (written in VB.net 2005) which I update via web downloads to my clients computers The downloaded file is saved in a subfolder until the next time the clients computer is started An entry in the registry HKCU\Software\Microsoft\Windows\CurrentVersion\Run launches my Update program on the next windows XP start
3
2943
by: Wayne | last post by:
I've just installed SQL Server 2005 Express together with SQL Management Studio Express on my local machine and I'm trying to upsize a data mdb to SQL Server using the upsizing wizard. The data mdb is also on my local machine. I've been at it for a couple of hours now and I keep getting the same error despite trying everything I can think of: Connection failed: SQLState: '01000' SQL Server Error: 2
0
1282
by: sheenitmathew | last post by:
Hai all, I developed an application software using VB 6.0 at front end and MS Access 2000 at the back end. The application runs very slow as the size of the database increses. I used ODBC to link the front and back ends, and copied the data base file to the user's
0
9217
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...
0
9076
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8926
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
6563
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
5903
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
4404
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...
0
4659
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2392
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2030
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.