I need to build a new table in memory that has two columns. Each will contain a from a different database (well one's a read in XML dataset) It's basically a table to translate the former primary key to the new primary key while the XML file gets imported into the Access database. So I need the datatype on both columns to be string. If I just make it and add data like this:
what will it do? Will it convert fish and cow to some wacky general object datatype and append stuff to it or put the value literally in double quotes or will it automatically change the column datatype to string or will it just crash saying I haven't specified a datatype yet or something?Code:Dim temptable As New DataTable temptable.Columns.Add("one") temptable.Columns.Add("two") Dim temp(1) As String temp(0) = "fish" temp(1) = "cow" temptable.rows.add(temp)
By the way, I'm adding columns with the simplest overload because I can't figure out how the heck to write the second part for the one where it's column name then datatype. You'd think it would be System.Data.DataColumn.DataType.string like the popup window suggests but nope![]()




Reply With Quote