i'm using VB
.NET and Microsoft Access.
and in one of my Access table is called Emp.mdb. and in that Emp.mdb i have lots of tables like MD1, MD2,......MD58 and MB1,MB2,......MB67 and some other tables too.
so when a button is pressed i need to check all the tables MD# and MB# and retrive some data to create an XML. and other tables were also there, but i don't need to check that tables. and the Number of MD tables and MB tables varies. so i need to check all the tables with MB# and MB#.
for checking Single table i used this code. how can i loop through all the tables MB# and MD# in Emp.mdb.
TextBox1.Text = "C:\Program\Emp.mdb"
If File.Exists(TextBox1.Text) Then
Dim strSQL As String = "Select ItemID,pl11,pl12 from MG10 where ItemID <> 0"
Dim myConnection As New OleDbConnection(strConn)
Dim myCommand As OleDbCommand = New OleDbCommand(strSQL, myConnection)
Dim myReader As OleDbDataReader = myCommand.ExecuteReader
Dim myXWriter As XmlTextWriter
Dim myWriter As StreamWriter
Dim myStream As MemoryStream
myStream = New MemoryStream
myXWriter = New XmlTextWriter(myStream, Encoding.UTF8)
myXWriter.Formatting = Formatting.Indented
myXWriter.Indentation = 2
Dim strConfig2 As String = New StreamReader(myStream).ReadToEnd()
myWriter = File.CreateText("C:\Example.xml")
if you have any idea please let me know. and if you can provide an example then it will be great helpfull for me.
thanks in advanace.