Why the follwing code (bold section) does not make any exception??(System.NullReferenceException)but the follwing does: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]I know i have to add a 'New' in the second, but why its not needed in the first?VB Code:
Dim tb As DataTable Dim clm As New DataColumn("first") tb.Columns.Add(clm)




Reply With Quote