: Example for getting the info to and from the file? I am not sure, here is how I would do.
:
: Make an XML file to hold connection string info...
:
<?xml version="1.0" standalone="yes"?>
: <Database_Config>
: <Settings>
: <DBConnection>My connection string</DBConnection>
: </Settings>
: </Database_Config>
:
: You can just make that file manually. If you want to be able to create it in your code.
:
Dim l_ds As New DataSet("Database_Config")
: Dim l_dt As New DataTable("Settings")
: Dim l_dr As DataRow
:
: l_dt.Columns.Add("DBConnection", GetType(String))
: l_dr = l_dt.NewRow()
: l_dr("DBConnection") = "My connection string"
: l_dt.Rows.Add(l_dr)
: l_ds.Tables.Add(l_dt)
:
: l_ds.WriteXml(".\DBConfig.XML")
:
: In your app init before you make your first DB connection read and set the connection string in module or location where everythign in the code that needs it can access it.
:
: 'somewhere
: Public m_DBConnection As String
:
:
: 'read value and make sure it is there
: l_ds.ReadXml(".\DBConfig.XML")
:
:
: If l_ds.Tables(0).Rows.Count = 0 Then
: 'no connection info found
:
: End If
:
: l_dr = l_ds.Tables(0).Rows(0)
:
: If Convert.IsDBNull(l_dr("DBConnection")) Then
: 'db string is null
:
: End If
:
: 'got it
: m_DBConnection = CStr(l_dr("DBConnection"))
:
: ~rlc
:
will try don't have much time. may have to give what I have as a work on progress. Thanks rlc will study this and see what i can see. would be nice if vb.net had a built in users option to chose/selects and alters where the database is located..