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