Hi all,
I am trying to pull out part of a string but am having problems figuring out how to do it with vb .net. The string comes from a record in a database.
The string looks like:
connectstring='Data Source=TESTSERVER;Initial Catalog=TESTDB;uid=sa;pwd=sa;'
I need to extract the uid and the pwd into two text boxes. I have code to find where for instance uid starts but can't figure out how to get the 'sa'
I assume I need a way to specify both a start and stop point and then get the text. This is what I have so far but it is not working.
Dim uid As String = lvConnection.SelectedItems(0).SubItems(1).Text
Dim uidEnd As String = lvConnection.SelectedItems(0).SubItems(1).Text
Dim uidtext As String
uid = uid.IndexOf("uid="

uidEnd = uidEnd.IndexOf(";pwd"

uidtext = lvConnection.SelectedItems(0).SubItems(1).Text.Substring(uid,2)
Any ideas are greatly appreciated..
Cheers and Happy New Year.
MDA