How to retrieve db table field's max length by using ADO.NET?

  • Thread starter Thread starter Jacky
  • Start date Start date
Not really, I think the documentation just stinks around this area. You can
use the OleDbDataAdapter. The select string something like "Select * from
MyTable", and then call adapter.FillSchema into a DataTable. It puts the
information into an empty table (no rows), but the Columns contains all the
info needed, length, null-able, primary key, etc.
 
Thanks Chris. I stand corrected.

Chris Botha said:
Not really, I think the documentation just stinks around this area. You can
use the OleDbDataAdapter. The select string something like "Select * from
MyTable", and then call adapter.FillSchema into a DataTable. It puts the
information into an empty table (no rows), but the Columns contains all the
info needed, length, null-able, primary key, etc.
 
Back
Top