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

Dynamic Sql Connection String

We are developing an asp.net web application. When we drag and drop the sql
connection object to the form we set the in the dynamic properties connection
string to use the connection string in the web.config file. Works Great
except everytime we need drag and drop a new data adapter on the form visual
studio automatically creates a new connection sql string object. Why? and how
to fix?

Nov 19 '05 #1
4 2396
Mike,

You can't stop the built in Adpapter from doing that. But you could make
your own Adapter control that doesn't do that. Just create a new control and
inherit the Adapter control. Then find and override the method that calls
and creates the new SQL Connection object and do nothing or hook up your
connection automatically via code.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Mike Moore" <Mi*******@discussions.microsoft.com> wrote in message
news:80**********************************@microsof t.com...
We are developing an asp.net web application. When we drag and drop the
sql
connection object to the form we set the in the dynamic properties
connection
string to use the connection string in the web.config file. Works Great
except everytime we need drag and drop a new data adapter on the form
visual
studio automatically creates a new connection sql string object. Why? and
how
to fix?

Nov 19 '05 #2
The strange thing is that this didn't happen on previous projects.

"S. Justin Gengo" wrote:
Mike,

You can't stop the built in Adpapter from doing that. But you could make
your own Adapter control that doesn't do that. Just create a new control and
inherit the Adapter control. Then find and override the method that calls
and creates the new SQL Connection object and do nothing or hook up your
connection automatically via code.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Mike Moore" <Mi*******@discussions.microsoft.com> wrote in message
news:80**********************************@microsof t.com...
We are developing an asp.net web application. When we drag and drop the
sql
connection object to the form we set the in the dynamic properties
connection
string to use the connection string in the web.config file. Works Great
except everytime we need drag and drop a new data adapter on the form
visual
studio automatically creates a new connection sql string object. Why? and
how
to fix?


Nov 19 '05 #3
Why can't the data adapters use the same sql connection string object?

"S. Justin Gengo" wrote:
Mike,

You can't stop the built in Adpapter from doing that. But you could make
your own Adapter control that doesn't do that. Just create a new control and
inherit the Adapter control. Then find and override the method that calls
and creates the new SQL Connection object and do nothing or hook up your
connection automatically via code.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Mike Moore" <Mi*******@discussions.microsoft.com> wrote in message
news:80**********************************@microsof t.com...
We are developing an asp.net web application. When we drag and drop the
sql
connection object to the form we set the in the dynamic properties
connection
string to use the connection string in the web.config file. Works Great
except everytime we need drag and drop a new data adapter on the form
visual
studio automatically creates a new connection sql string object. Why? and
how
to fix?


Nov 19 '05 #4
Mike,

They can, but you have to set that in code. But you can't set it until it's
already on the page. Really the only way to get the default behaviour you
want is to create your own control. That's why it's great that .NET utilizes
inheritance, you can access all the prewritten behaviours of the control
with a single line of code:

Inherits System.Data.SqlClient.SqlDataAdapter

And then customize it to do what you want.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Mike Moore" <Mi*******@discussions.microsoft.com> wrote in message
news:10**********************************@microsof t.com...
Why can't the data adapters use the same sql connection string object?

"S. Justin Gengo" wrote:
Mike,

You can't stop the built in Adpapter from doing that. But you could make
your own Adapter control that doesn't do that. Just create a new control
and
inherit the Adapter control. Then find and override the method that calls
and creates the new SQL Connection object and do nothing or hook up your
connection automatically via code.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Mike Moore" <Mi*******@discussions.microsoft.com> wrote in message
news:80**********************************@microsof t.com...
> We are developing an asp.net web application. When we drag and drop the
> sql
> connection object to the form we set the in the dynamic properties
> connection
> string to use the connection string in the web.config file. Works
> Great
> except everytime we need drag and drop a new data adapter on the form
> visual
> studio automatically creates a new connection sql string object. Why?
> and
> how
> to fix?
>


Nov 19 '05 #5

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

Similar topics

0
by: Ronald Colijn via .NET 247 | last post by:
Hello all you people, Thanks for reading this. I hve a strange thing which annoys me noend. I am using VS.NET with MS-Access DB, framework version 1.1,Windows XP Pro, IIS 5.1. In my webforms I...
2
by: Mike Moore | last post by:
We are developing an asp.net web application. When we drag and drop the sql connection object to the form we set the in the dynamic properties connection string to use the connection string in the...
1
by: timandsuzi36 | last post by:
Here's the issue. Appreciate any help any Access gurus can offer. I have a .NET WinForms application that needs to launch a Access DB application used for generating Access Reports. That part...
5
by: Mike | last post by:
I am writing a .NET application in C# that uses Crystal Reports. I want the crystal reports to grab information from a database no matter where the database is located. To do this, I want to...
7
by: Mike Livenspargar | last post by:
We have an application converted from v1.1 Framework to v2.0. The executable references a class library which in turn has a web reference. The web reference 'URL Behavior' is set to dynamic. We...
3
by: topmind | last post by:
I am generally new to dot.net, coming from "scriptish" web languages such as ColdFusion and Php. I have a few questions if you don't mind. First, how does one go about inserting dynamic SQL...
5
by: alingsjtu | last post by:
Hello, every body. When execute dynamic generated multiple OPENQUERY statements (which linkes to DB2) in SQLServer, I always got SQL1040N The maximum number of applications is already connected...
3
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however,...
2
by: DaveL | last post by:
Hello I want to build Dynamic Paramers for a Sql Insert below is what i have so far but...determinthe column type and length im having Problems with Tks dave string sInsert = "Insert into...
1
by: Dean Slindee | last post by:
VS2008, .NetFramework 3.5 SP1: I have built a LINQ data access layer project. When the LINQ data context was built over an existing SQL2005 database, the connection string for that database was...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.