I have written a function that imports data from another software's format into a .Net DataSet. I now am working on functions to be able to export this data into various different formats excel access fox etc. I have this working well within this particular application but figured this would be a nice class to put together.
The problem I am having is trying to make it a bit more generic so it would be a useful class. Because I have a "schema" file that describes the data I am importing it is fairly easy to export the data to oledb.
But when I just read and XML file using read XML how would I retrieve the "schema" about this data in order to create an oledb table using create table. For example below I have populated the max Columns.maxlength property while I was importing the data, all fields ar varchar.
'Populate Field Name
str = "Create Table " & tablename & " ("
For i = 0 To table.Columns.Count - 1
str = str & "[" & table.Columns(i).ColumnName & "] varchar(" & table.Columns(i).MaxLength & ") ,"
Next
str = Mid(str, 1, str.Length - 1) & ")"
So I end up with Create Table xx ([F1] varchar( 40)) etc.. Which is fine in my app but would not work as a generic class. So I guess what i need is a way to determine what type of data I have in a field and its length if it is a text field.
Thanks and ideas would be welcome.
Paul
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only