DataSets and MaxLength Column property

Hi,

Is there a way of populating a DataSet with its data and column Maxlength properties    The only way I can think of doing this is to use the following method:

(C#)
GetOleDbSchemaTable(OleDbSchemaGuid.Columns, 
              new object[]{null, null, dsDataSet.Tables[0].TableName, null})



and then looping through my DataSet object updating the MaxLength properties from the GetOleDbSchemaTable method.

Is there a way of using the DataAdapter.Fill method to achieve this automatically 


Thanks in advance

Mark


Answer this question

DataSets and MaxLength Column property

  • redkardinal

    do a 
    adpt.fillschema(dt,from source)

    Then do a normal fill.

    The from source is the option (forget the exact name).

    This will pupluate quite a bit of info that doesn't currently get populated.

  • Pieter van Kampen

    Thanks Joe, that worked a treat !!  And its a million times faster than my looping through the dataset.

    :-)

  • DataSets and MaxLength Column property