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

UDL Files

Has anyone used UDL files with C#.net? I have not done this before and
have always used the normal connection string, but have been asked to
research this. Does anyone have an example? Are there any disadvantages
to doing it this way? Does the UDL method still take advantage of
connection pooling? Thanks!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #1
3 6911
Hello Philip,

It's actually easy.

You create an empty file in any editor and name it, say, "MyConnection.udl".
Then double-click on this file in Windows Explorer to bring up the Data Link
Properties window and set up necessary connection parameters. Then use the
"Test Connection" button to ensure the connection has been properly
configured.

Next, construct a connection string like this:

"File Name = e:\MyConnection.udl" (not sure this is enough for ADO .NET
though, worked like a charm with ADO)

and you are done.

Connection pooling should work as usual.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://www.x-unity.net/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Philip Townsend" <pt*******@v1tech.com> wrote in message
news:ea**************@TK2MSFTNGP09.phx.gbl...
Has anyone used UDL files with C#.net? I have not done this before and
have always used the normal connection string, but have been asked to
research this. Does anyone have an example? Are there any disadvantages
to doing it this way? Does the UDL method still take advantage of
connection pooling? Thanks!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 15 '05 #2
One more addition - seems that with ADO .NET, UDLs can be used with the
OLEDB managed provider, but not with the MSSQL managed provider.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://www.x-unity.net/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Philip Townsend" <pt*******@v1tech.com> wrote in message
news:ea**************@TK2MSFTNGP09.phx.gbl...
Has anyone used UDL files with C#.net? I have not done this before and
have always used the normal connection string, but have been asked to
research this. Does anyone have an example? Are there any disadvantages
to doing it this way? Does the UDL method still take advantage of
connection pooling? Thanks!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 15 '05 #3

"Philip Townsend" <pt*******@v1tech.com> wrote in message
news:ea**************@TK2MSFTNGP09.phx.gbl...
Has anyone used UDL files with C#.net? I have not done this before and
have always used the normal connection string, but have been asked to
research this. Does anyone have an example? Are there any disadvantages
to doing it this way? Does the UDL method still take advantage of
connection pooling? Thanks!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


In addition to Mr. Lapshin's comments I would like to add the following
amplification.
UDL files were originally the OLE DB equivalent of an ODBC (.dsn) file. The
only difference was, where as you had to go into the ODBC admin to create a
..dsn (actually you could do it by scratch - but why?), with a .udl the
wizard opened automatically when opening an .udl file - thereby removing the
need for an additional .cpl file in settings.

Such files and the accompanying wizards were helpful to create connection
strings and made it easier for new programmers. They were also handy to pass
around "connection information" in little xcopy'ble files and made it very
easy to modify connection information outside of the application. (It was
not uncommon to have a "testdb.udl" and a "productiondb.udl".) This become
less interesting with the advent of connection.open calls that took full
connection strings and as programmers became more familiar with connection
string syntax.

However, both files are plain accii text with well-documented structures and
in the "clear" so to speak, so they do present a possible security risk. For
this reason mainly, M$ has tended to down-grade the use of these external
files.

UDL, by definition, works with OLE DB, but not the newer ADO.NET specific db
drivers, just as they are inappropriate for use with ODBC providers. (This
last statement gets kind of confusing since you can use OLE DB ODBC
drivers.)

Unless there is no serious security problem having an open file, or a real
need to change out access to multiple databases (on the fly), or no reason
to use the newer ADO.NET providers there is little reason to use UDLs or
DSNs.

The single exception is that they are a create development tool to quickly
create connection strings and 'test' connections.

-ralph
Nov 15 '05 #4

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

Similar topics

2
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
44
by: Xah Lee | last post by:
here's a large exercise that uses what we built before. suppose you have tens of thousands of files in various directories. Some of these files are identical, but you don't know which ones are...
0
by: Tom Lee | last post by:
Hi, I'm new to .NET 2003 compiler. When I tried to compile my program using DEBUG mode, I got the following errors in the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7 \include\xdebug...
18
by: JKop | last post by:
Here's what I know so far: You have a C++ project. You have source files in it. When you go to compile it, first thing the preprocessor sticks the header files into each source file. So now...
3
by: pooja | last post by:
Suppose i have created a class c1 with f1()in c1.cpp and included this c1.cpp in file1.cpp file , which is also having main() by giving the statement #include "c1.cpp". the same i can do by...
11
by: ambika | last post by:
Iam just trying to know "c". And I have a small doubt about these header files. The header files just contain the declaration part...Where is the definition for these declarations written??And how...
22
by: Daniel Billingsley | last post by:
Ok, I wanted to ask this separate from nospam's ridiculous thread in hopes it could get some honest attention. VB6 had a some simple and fast mechanisms for retrieving values from basic text...
18
by: UJ | last post by:
Folks, We provide custom content for our customers. Currently we put the files on our server and people have a program we provide that will download the files. These files are usually SWF, HTML or...
0
by: wal | last post by:
How does one attach files to emails using libgmail? The following code http://pramode.net/articles/lfy/fuse/4.txt works fine when said files are simple text files, but it failes as soon as the...
3
by: aRTx | last post by:
I have try a couple of time but does not work for me My files everytime are sortet by NAME. I want to Sort my files by Date-desc. Can anyone help me to do it? The Script <? /* ORIGJINALI
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.