get DataColumn length

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,
another ADO problem:
how can i get the Column legth as declaredat the Sql data base?
for example - char(6)filed, char(10), ..,
the DataColumn.DataType property bring me the Type System.String for those
columns but i need the specific length,
is it possible?
thank's
stan
 
The best solution to your problem(s) is to use the sp_help, you will get all
the info you need table name, column size etc.
Also you could use sp_columns just to get the column length.
 
thanks for your response,
sp_help or sp_columns will not help me because my module is a business logic
level and cant reach the data base directly,
i am dealing only with DataTable and it's DataColumns!
another point is that if i will use sp_help\sp_columns it will not work on
onother Data Base (oracle),
way the ADO object (DataColumn) cant supply me the lenght of the field? it's
give me the Name & the Type but not the length! it's strange.
thanks anyway
stan.
 
In this case (SQL Server+Oracle +…) you will need a data abstraction layer at
the lower level, that will fill this information in the DataTable,
DataColumns. .Net support for these kind of information is very limited (and
data provider dependent).
 
Back
Top