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

UDL file and SqlConnection

I just noticed that the SqlConnection class will not accept "file
name=c:\SomeUDL.udl" as its connectionstring property. However, the
OleDbConnection class will use it. Can anyone tell me why?

If the SqlConnection class is optimized to work with SQL Server, I'd rather
use it, but I don't want to hard-code my connection string into the app.

Thanks in advance,
Tom
Nov 15 '05 #1
1 8897
Tom,

You will have to find some way of getting the connection string from the
UDL file and then passing it to the SqlConnection class. The UDL file is
for OLEDB, so that is why it doesn't work. I think that what you can do is
take everything after the "Provider" section (not including the provider
name) and then use that.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Tom Hartnett" <TH*******@truemfg.com> wrote in message
news:ut**************@TK2MSFTNGP12.phx.gbl...
I just noticed that the SqlConnection class will not accept "file
name=c:\SomeUDL.udl" as its connectionstring property. However, the
OleDbConnection class will use it. Can anyone tell me why?

If the SqlConnection class is optimized to work with SQL Server, I'd rather use it, but I don't want to hard-code my connection string into the app.

Thanks in advance,
Tom

Nov 15 '05 #2

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

Similar topics

7
by: Leszek | last post by:
Hello, I have an XmlReader object containg some Xml code. I would like to export this document from the reader to an Xml file. How to do this? Thanks for any hints, Leszek Taratuta
4
by: Ed_P. | last post by:
Hello, I have the following scenario: I have a solution with 4 projects Project1 = MainWindow (Windows EXE) Project2 = PresentationLayer (DLL) Project3 = BusinessLayer (DLL) Project4 =...
3
by: Joe via DotNetMonster.com | last post by:
Hi, I'm creating a Class file that contains a function that queries the database. I receive alot of connection type errors when I try to compile and I'm not sure what I'm doing wrong. This is...
0
by: Daniel | last post by:
Hi, I have trouble in downloading the excel file from sql database. After downloading, i try to open it, the error msg prompt:"The file in not in a recognizable format" Any ideas? i already...
4
by: AlexDP | last post by:
My program has to access an SQL Server DB file that is in the same folder as the executable. i dont want to setup a server. i was able to do this on my own computer, the program would access any...
0
by: Mike Collins | last post by:
I am trying to export data from multiple tables in SQL Server to an XML file so I can then import it to another database. It seems to be working fine for exporting, but I am having trouble...
5
by: Mike Collins | last post by:
I am trying to export data from multiple tables in SQL Server to an XML file so I can then import it to another database. It seems to be working fine for exporting, but I am having trouble...
3
bencoding
by: bencoding | last post by:
Wow, I've spent about 3 hrs now trying to figure this one out, none of the articles online were able to help me and some were using system libraries that were obsolete......anyways, I am able to...
2
by: cmrhema | last post by:
Hi All , I have with me a server socket program, I am receiving all the clients, but what happens is i have to write it into a file. This consumes time. So we do not have a data loss, but as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
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:
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...
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...
0
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,...

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.