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

How to get list of connection string keywords available in sqlclie

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/lib...ng(vs.80).aspx
but I want to get this list programmatically.
Sep 19 '07 #1
5 2639
"Peter" <Pe***@discussions.microsoft.comschrieb
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/lib...ng(vs.80).aspx
but I want to get this list programmatically.
I think it's not possible. At least the provider specific keyword's are
interpreted by the data provider.

But maybe the System.Data.SqlClient.SqlConnectionStringBuilder class helps?
Armin

Sep 19 '07 #2
Hi Armin,

It seems that I can get the list from an instance of
System.Data.SqlClient.ConnectionStringBuilder. Not sure how to get it yet
since I'm not familiar of collections.

"Armin Zingler" wrote:
"Peter" <Pe***@discussions.microsoft.comschrieb
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/lib...ng(vs.80).aspx
but I want to get this list programmatically.

I think it's not possible. At least the provider specific keyword's are
interpreted by the data provider.

But maybe the System.Data.SqlClient.SqlConnectionStringBuilder class helps?
Armin

Sep 20 '07 #3
"Peter" <Pe***@discussions.microsoft.comschrieb
Hi Armin,

It seems that I can get the list from an instance of
System.Data.SqlClient.ConnectionStringBuilder. Not sure how to get
it yet since I'm not familiar of collections.

"Armin Zingler" wrote:
"Peter" <Pe***@discussions.microsoft.comschrieb
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/lib...ng(vs.80).aspx
but I want to get this list programmatically.
I think it's not possible. At least the provider specific
keyword's are interpreted by the data provider.

But maybe the System.Data.SqlClient.SqlConnectionStringBuilder
class helps?

I didn't think of this class as being a collection like data source, more I
pointed to it because you can browse the available properties/keywords and
explicitly set them "early bound" without the need to fill the values into a
connection string. Though, I had a closer look at it, finding that it
implements IEnumerable, so you can use For Each:

Dim sb As New System.Data.SqlClient.SqlConnectionStringBuilder

sb.ConnectTimeout = 17
sb.DataSource = "test"

For Each pair As KeyValuePair(Of String, Object) In sb
'access the Key and Value propertis of object 'pair'
Next

May I ask why you need this?

Armin

Sep 20 '07 #4
Thanks Armin. I'm thinking about providing administrator of an application
the ability to set some of those keywords and then build the connection
string dynamcially. I can hardcode them instead of retrieving them
programmatically.
I wonder whether those keywords will expand automatically when the
underlying sqlclient provider support more keywords.

Using your sample coding will only fetch those keywords which have values
assigned. If I want to get all the keywords, I need to go thru the
keys.syncroot array and I don't think I can use KeyValuePair to loop thru
them.

Peter

"Armin Zingler" wrote:
"Peter" <Pe***@discussions.microsoft.comschrieb
Hi Armin,

It seems that I can get the list from an instance of
System.Data.SqlClient.ConnectionStringBuilder. Not sure how to get
it yet since I'm not familiar of collections.

"Armin Zingler" wrote:
"Peter" <Pe***@discussions.microsoft.comschrieb
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/lib...ng(vs.80).aspx
but I want to get this list programmatically.
>
I think it's not possible. At least the provider specific
keyword's are interpreted by the data provider.
>
But maybe the System.Data.SqlClient.SqlConnectionStringBuilder
class helps?


I didn't think of this class as being a collection like data source, more I
pointed to it because you can browse the available properties/keywords and
explicitly set them "early bound" without the need to fill the values into a
connection string. Though, I had a closer look at it, finding that it
implements IEnumerable, so you can use For Each:

Dim sb As New System.Data.SqlClient.SqlConnectionStringBuilder

sb.ConnectTimeout = 17
sb.DataSource = "test"

For Each pair As KeyValuePair(Of String, Object) In sb
'access the Key and Value propertis of object 'pair'
Next

May I ask why you need this?

Armin

Sep 20 '07 #5
"Peter" <Pe***@discussions.microsoft.comschrieb
Thanks Armin. I'm thinking about providing administrator of an
application the ability to set some of those keywords and then build
the connection string dynamcially. I can hardcode them instead of
retrieving them programmatically.
I wonder whether those keywords will expand automatically when the
underlying sqlclient provider support more keywords.

Using your sample coding will only fetch those keywords which have
values assigned. If I want to get all the keywords, I need to go
thru the keys.syncroot array and I don't think I can use
KeyValuePair to loop thru them.
Why don't you put all possible keywords into a list? Has to be done once
only.
Armin

Sep 21 '07 #6

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

Similar topics

2
by: Ellen Manning | last post by:
I'm developing an A2K adp that contains doctor info and the months they are not available for teaching. A doctor can be unavailable for some months for one year and other months for another year. ...
5
by: Gerrit Beuze | last post by:
Hi all, Using C# 1.1: I need a fast way of determining whether a string is in a list of approx 150 keyword like strings. in two versions: one case-sensitive, the other one case-insenstive. I...
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
2
by: Nuno Magalhaes | last post by:
In a sample code I do something like this: //Populate IP List IPHost=Dns.GetHostByName(Dns.GetHostName()); DefaultIPCombo.Items.Clear(); DefaultIPCombo.Items.Add(IPHost.AddressList.ToString());...
8
by: John Smith | last post by:
How do I connect to a FoxPro 7 database?
77
by: Ville Vainio | last post by:
I tried to clear a list today (which I do rather rarely, considering that just doing l = works most of the time) and was shocked, SHOCKED to notice that there is no clear() method. Dicts have it,...
3
by: Martin B | last post by:
Hallo! I'm working with C# .NET 2.0, implementing Client/Server Applications which are connecting via Network to SQL-Server or Oracle Databases. To stay independent from the underlaying Database...
15
by: Bit byte | last post by:
I am writing a small parser object. I need to store keywords etc in lsts. Because this data is to be shared by all instances of my parser class, I have declared the variable as class variables...
1
by: ronrsr | last post by:
I have a single long string - I'd like to split it into a list of unique keywords. Sadly, the database wasn't designed to do this, so I must do this in Python - I'm having some trouble using the...
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
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?
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
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.