Home All Groups Group Topic Archive Search About
Author
4 May 2006 6:01 AM
stanley
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

Author
4 May 2006 11:16 AM
MrSmersh
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.


Show quote
"stanley" wrote:

> 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
>
>
>
Author
4 May 2006 12:41 PM
stanley
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.


Show quote
"MrSmersh" wrote:

> 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.
>
>
> "stanley" wrote:
>
> > 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
> >
> >
> >
Author
4 May 2006 1:14 PM
MrSmersh
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).

Show quote
"stanley" wrote:

> 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.
>
>
> "MrSmersh" wrote:
>
> > 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.
> >
> >
> > "stanley" wrote:
> >
> > > 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
> > >
> > >
> > >

AddThis Social Bookmark Button