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

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:

<connectionStrings>
<clear />
<add name="LocalSqlServer" connectionString="Data
Source=.\SQL2005;AttachDbFilename=|DataDirectory|\ ASPNETDB.MDF;user
instance=true;Integrated Security=True;Initial Catalog=ASPNETDB;"
providerName="System.Data.SqlClient" />
</connectionStrings>

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.SqlClient.SqlException: 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 6688
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:

<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer"
connectionString="server=localhost;database=Articl es;uid=sa;pwd="
providerName="System.Data.SqlClient" />
</connectionStrings>
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:

<connectionStrings>
<clear />
<add name="LocalSqlServer" connectionString="Data
Source=.\SQL2005;AttachDbFilename=|DataDirectory|\ ASPNETDB.MDF;user
instance=true;Integrated Security=True;Initial Catalog=ASPNETDB;"
providerName="System.Data.SqlClient" />
</connectionStrings>

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.SqlClient.SqlException: 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**@discussions.microsoft.com> wrote in message news:56**********************************@microsof t.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:

<connectionStrings>
<clear />
<add name="LocalSqlServer" connectionString="Data
Source=.\SQL2005;AttachDbFilename=|DataDirectory|\ ASPNETDB.MDF;user
instance=true;Integrated Security=True;Initial Catalog=ASPNETDB;"
providerName="System.Data.SqlClient" />
</connectionStrings>

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.SqlClient.SqlException: 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*********************@g10g2000cwb.googlegro ups.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.SqlServices.Install("server", "USERNAME", "PASSWORD",
"databasename", 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**@discussions.microsoft.com> wrote in message news:56**********************************@microsof t.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:

<connectionStrings>
<clear />
<add name="LocalSqlServer" connectionString="Data
Source=.\SQL2005;AttachDbFilename=|DataDirectory|\ ASPNETDB.MDF;user
instance=true;Integrated Security=True;Initial Catalog=ASPNETDB;"
providerName="System.Data.SqlClient" />
</connectionStrings>

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.SqlClient.SqlException: 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*******@yahoo.nospammin.com> wrote in message
news:92**********************************@microsof t.com...
Jon,
You do not need to "upload the MDF file" and attach it. YOu can enable any
database with this code:

Management.SqlServices.Install("server", "USERNAME", "PASSWORD",
"databasename", 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**@discussions.microsoft.com> wrote in message news:56**********************************@microsof t.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:
>
> <connectionStrings>
> <clear />
> <add name="LocalSqlServer" connectionString="Data
> Source=.\SQL2005;AttachDbFilename=|DataDirectory|\ ASPNETDB.MDF;user
> instance=true;Integrated Security=True;Initial Catalog=ASPNETDB;"
> providerName="System.Data.SqlClient" />
> </connectionStrings>
>
> 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.SqlClient.SqlException: 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*******@yahoo.nospammin.com> wrote in message
news:92**********************************@microsof t.com...
Jon,
You do not need to "upload the MDF file" and attach it. YOu can enable any
database with this code:

Management.SqlServices.Install("server", "USERNAME", "PASSWORD",
"databasename", 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**@discussions.microsoft.com> wrote in message news:56**********************************@microsof t.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:
>
> <connectionStrings>
> <clear />
> <add name="LocalSqlServer" connectionString="Data
> Source=.\SQL2005;AttachDbFilename=|DataDirectory|\ ASPNETDB.MDF;user
> instance=true;Integrated Security=True;Initial Catalog=ASPNETDB;"
> providerName="System.Data.SqlClient" />
> </connectionStrings>
>
> 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.SqlClient.SqlException: 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*******@yahoo.nospammin.com> wrote in message
news:C2**********************************@microsof t.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*******@yahoo.nospammin.com> wrote in message
news:92**********************************@microsof t.com...
> Jon,
> You do not need to "upload the MDF file" and attach it. YOu can enable any
> database with this code:
>
> Management.SqlServices.Install("server", "USERNAME", "PASSWORD",
> "databasename", 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**@discussions.microsoft.com> wrote in message news:56**********************************@microsof t.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:
>> >
>> > <connectionStrings>
>> > <clear />
>> > <add name="LocalSqlServer" connectionString="Data
>> > Source=.\SQL2005;AttachDbFilename=|DataDirectory|\ ASPNETDB.MDF;user
>> > instance=true;Integrated Security=True;Initial Catalog=ASPNETDB;"
>> > providerName="System.Data.SqlClient" />
>> > </connectionStrings>
>> >
>> > 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.SqlClient.SqlException: 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
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...
5
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....
4
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...
7
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...
3
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...
2
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...
1
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...
3
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...
0
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.