get DataColumn length

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
 
G

Guest

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.
 
G

Guest

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.
 
G

Guest

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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top