"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