I have an xml file create in the IDE called app.config that stores
the location of my database for my app THanks Spebby
I create a an OpenFileDialog that I create that will get the location of the database
My problem is how do I use the OpenDialog.Filename to edit the XML file and change the path of the database?
example how to change the path from
M:\VB_NET_2005\TimeSheet\bin\Debug\TSDB.mdb to the string stored in OpenDialog.FileName
Newbie in search of knowledge
the location of my database for my app THanks Spebby
Code:
<connectionStrings>
<add name="DatabaseConnection"
connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=
M:\VB_NET_2005\TimeSheet\bin\Debug\TSDB.mdb"
providerName="System.Data.OleDb" />
</connectionStrings>
I create a an OpenFileDialog that I create that will get the location of the database
Code:
Dim OpenDialog As New OpenFileDialog
OpenDialog.Title = "Open Database"
OpenDialog.Filter = "Microsoft Access Database (*.mdb)|*.mdb|All Files (*.*)|*.*"
OpenDialog.FileName = ""
OpenDialog.FilterIndex = 0
OpenDialog.InitialDirectory = "C:\Program Files"
OpenDialog.CheckFileExists = True
OpenDialog.CheckPathExists = True
If OpenDialog.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
'(OpenDialog.FileName)
End If
My problem is how do I use the OpenDialog.Filename to edit the XML file and change the path of the database?
example how to change the path from
M:\VB_NET_2005\TimeSheet\bin\Debug\TSDB.mdb to the string stored in OpenDialog.FileName
Newbie in search of knowledge