473,581 Members | 2,783 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HOW TO: Build a Connection String Programmaticall y

_DS
There is an article on MSDN called: "HOW TO: Build a Connection String
Programmaticall y in ADO.NET by Using Visual C# .NET"
http://support.microsoft.com/default...b;EN-US;310083

The article outlines adding refs to MSDASC and adodb to a project in
order to interactively generate and test a db connect string.

I can't imagine that VS2005 would still be ref'ing older com modules
for this. What is the new function?

Jan 17 '06 #1
3 7070
Hi,

there is a DbConnectionStr ingBuilder base class in .net 2.
Database specific classes inherit from it, such as
SqlConnectionSt ringBuilder class.

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"_DS" <_D*@Nospamform e.com> wrote in message
news:vp******** *************** *********@4ax.c om...
There is an article on MSDN called: "HOW TO: Build a Connection String
Programmaticall y in ADO.NET by Using Visual C# .NET"
http://support.microsoft.com/default...b;EN-US;310083

The article outlines adding refs to MSDASC and adodb to a project in
order to interactively generate and test a db connect string.

I can't imagine that VS2005 would still be ref'ing older com modules
for this. What is the new function?

Jan 17 '06 #2
_DS
On Tue, 17 Jan 2006 10:51:24 +0100, "Miha Markic [MVP C#]" <miha at
rthand com> wrote:
Hi,

there is a DbConnectionStr ingBuilder base class in .net 2.
Database specific classes inherit from it, such as
SqlConnectionS tringBuilder class.


That's part 2 of what I was trying to recall, but that's the
string-cat function that assembles the string after individual
components are formed. (I had actually written a class that
did that, pre-VS2005)

The main function that I was looking for is similar to VS2005's
built-in "Add/Modify Connection Dialog Box" but done programmaticall y.
In other words, the user of my program would have the equivalent of
the Visual Studio Connection Wizard.

Again, I had done this with VS2003 by using the COM module that I had
mentioned, but I do believe there is a .NET version now. That would
be nice, as VS2005 does not like the COM module much.

....and probably
Jan 18 '06 #3
Ah, I see.
I don't think that there is anything like that (UI) out of the box but
nothing prevents you from updating your existing code...(mostly you would
have to comment it out)

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"_DS" <_D*@Nospamform e.com> wrote in message
news:qn******** *************** *********@4ax.c om...
On Tue, 17 Jan 2006 10:51:24 +0100, "Miha Markic [MVP C#]" <miha at
rthand com> wrote:
Hi,

there is a DbConnectionStr ingBuilder base class in .net 2.
Database specific classes inherit from it, such as
SqlConnection StringBuilder class.


That's part 2 of what I was trying to recall, but that's the
string-cat function that assembles the string after individual
components are formed. (I had actually written a class that
did that, pre-VS2005)

The main function that I was looking for is similar to VS2005's
built-in "Add/Modify Connection Dialog Box" but done programmaticall y.
In other words, the user of my program would have the equivalent of
the Visual Studio Connection Wizard.

Again, I had done this with VS2003 by using the COM module that I had
mentioned, but I do believe there is a .NET version now. That would
be nice, as VS2005 does not like the COM module much.

...and probably

Jan 18 '06 #4

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

Similar topics

10
2313
by: Douglas Buchanan | last post by:
I am using the following code instead of a very lengthly select case statement. (I have a lot of lookup tables in a settings form that are selected from a ListBox. The data adapters are given a similar name to the table. Rather than making a long Select Case that could become obsolete if lookup tables are added and the source table of the...
6
2147
by: H | last post by:
This is a question that has haunted me for quite some time. if you build a 4 tier database application where the 4th tier is the database server (MS SQL 2000), where do you build the connection string? The obvious answer is to hard code it into the middle layer and use a config file. The problem is the database application needs to be...
4
1081
by: Bob Garbados | last post by:
Is it possible to determine the tables, relationships, keys, columns, and datatypes in a database? If so, how? I want to build an app that can connect to a specified sql2000 database and construct a form for updating data. Has anyone successfully done this? Thanks.
0
974
by: Sankalp | last post by:
Hi, I am tryin to create an internet connection and download a particular file from a specified URL programmatically using VB on a WIN 95 machine. The code that I use is as follows: Private Const INTERNET_OPEN_TYPE_PRECONFIG = 0 Private Const INTERNET_OPEN_TYPE_DIRECT = 1 Private Const INTERNET_OPEN_TYPE_PROXY = 3
5
7347
by: Zlatko Matiæ | last post by:
Hello. In ODBC Data Source Administrator, there is a tab "Connection Pooling" and option "PerfMon" Enable/Disable. Could someone explain the meaning of the option and how it reflects to Access when having ODBC linked tables, JET queries on linked tables and pass-through queries? Thanks,
4
5045
by: sydney.luu | last post by:
Hello, I would greatly appreciate if someone can show me how to dynamically build a Repeater with unknown number of columns at design time. I have looked various threads in this newsgroup, websites, MSDN and was not able to find something that would help me understand and code. I might not be searching for the right words or phrases. ...
2
3258
by: Orit | last post by:
Hello . Please find below my questions - I hope some of the ASP.NET experts of this forum will answer to those beginner's questions : My Web site should be able to work with either SQL Server or Access database as following : It will connect first to the Master database (SQL or Access, connection String of this database should be read...
5
2656
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
How can I get the list of connection string's keywords available in sqlclient programmatically? I have found the list in here http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring(vs.80).aspx but I want to get this list programmatically.
2
1616
by: Man T | last post by:
I just wonder what is/are your practices to build the SQL Server connection string? Use object to build the connection string from config file or somewhere?
1
7910
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...
0
8180
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...
0
6563
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5681
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...
0
5366
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...
0
3809
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...
0
3832
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2307
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
0
1144
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...

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.