Originally posted by Lunatic3
VB Code:
Dim adapt As New Data.OleDb.OleDbDataAdapter(slectiontext,myconnection)
Dim ds As New DataSet()
adapt.FillSchema(ds, SchemaType.Mapped)
[b]Dim tb As DataTable = ds.Tables(0)
MessageBox.Show(tb.Columns(0).ColumnName)<b>Why the follwing code (bold section) does not make any exception??(System.NullReferenceException)</b>
but the follwing does:
VB Code:
Dim tb As DataTable
Dim clm As New DataColumn("first")
tb.Columns.Add(clm)
I know i have to add a 'New' in the second, but why its not needed in the first? [/B]