473,406 Members | 2,343 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.

How change Connection name for Dataset

Using ASP.NET 2.0

Created DataSet1.xsd. It's using the Connection "ASPNETDBConnectionString
(Web.config)". I want to use a different one, LocalSqlServer. How do I
change it?

I tried to change the Connection/Name property of the adapter to
"LocalSqlServer (Web.config)", but it says "Property value is not valid."

Any ideas? Thanks!

Here's my connection strings in my web.config...

<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|\ASPNETDB.MDF;Integrated
Security=True;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
Sep 6 '07 #1
2 3372
Open web config and look at teh connection strings portion. If you do not
have one for LocalSqlServer, you will never get anywhere with this approach.

I assume you are using table adapters?

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box!
|
*************************************************
"VB Programmer" <do**********@somewhere.comwrote in message
news:OL**************@TK2MSFTNGP03.phx.gbl...
Using ASP.NET 2.0

Created DataSet1.xsd. It's using the Connection "ASPNETDBConnectionString
(Web.config)". I want to use a different one, LocalSqlServer. How do I
change it?

I tried to change the Connection/Name property of the adapter to
"LocalSqlServer (Web.config)", but it says "Property value is not valid."

Any ideas? Thanks!

Here's my connection strings in my web.config...

<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|\ASPNETDB.MDF;Integrated
Security=True;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>


Sep 6 '07 #2
Yes. I'm using LocalSqlServer throught the web project. It's in the
web.config and working fine.

I just want to know how I can make DataSet1.xsd use LocalSqlServer. It
keeps wanted to use the other one.

Thanks.

"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamMwrote in
message news:Ou**************@TK2MSFTNGP05.phx.gbl...
Open web config and look at teh connection strings portion. If you do not
have one for LocalSqlServer, you will never get anywhere with this
approach.

I assume you are using table adapters?

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box! |
*************************************************
"VB Programmer" <do**********@somewhere.comwrote in message
news:OL**************@TK2MSFTNGP03.phx.gbl...
>Using ASP.NET 2.0

Created DataSet1.xsd. It's using the Connection
"ASPNETDBConnectionString (Web.config)". I want to use a different one,
LocalSqlServer. How do I change it?

I tried to change the Connection/Name property of the adapter to
"LocalSqlServer (Web.config)", but it says "Property value is not valid."

Any ideas? Thanks!

Here's my connection strings in my web.config...

<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirecto ry|\ASPNETDB.MDF;Integrated
Security=True;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>



Sep 7 '07 #3

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

Similar topics

13
by: Larry | last post by:
Hi I have asp.net programs. I used a very simple data transfer method by using URLs ¡°First.aspx¡± contents a line to send data to the ¡°second.aspx¡± page, for
4
by: Avon | last post by:
Hi there, I am very sorry for my not perfect English. I've got very simple question. Is it possible to have stored procedure with 2 result tables and then from my application to refer to this...
19
by: Jaime Stuardo | last post by:
Hi all.. I have created a business logic component that is used from my ASP.NET webform. It works, but connection string to the database is hard coded, as in this method : public DataSet...
7
by: Wayne Wengert | last post by:
I am using VB with a Windows NET application. I have a datagrid in which the user can add rows using the "*" row. I want to detect whenever the user has added a row. I found the following code at...
0
by: mateo | last post by:
So here i've made a typed dataset in vs2005 by picking some tables in the server explorer. It generated a typed dataset with everything inside it ok. Now i've decided to put this newly created...
37
by: sam44 | last post by:
Hi, At startup the user log on and chooses the name of a client from a dropdownlist, which then changes dynamically the connection string (the name of the client indicates which database to use)....
4
by: wilson | last post by:
Hi. I'm new in VB.NET. I would like to ask a question. How to change ConnectionString for DataSet at runtime? Because I want to change the dBase data file directory according to the program...
1
by: Randy | last post by:
I just had to rebuild my computer and have reorganized my file structure. I have a dataset established at design time with many tables, etc. I have moved my mdf folder to a new location and now I...
1
by: BobLewiston | last post by:
I’m trying to learn how to connect to an SQL Server database (I’m using the AdventureWorks sample database), but I’m having problems. Here’s the code I’m using: // define connection string for...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.