开发者

Is it possible to know the datatype of the column returned from Stored Proc records set from ado.net

开发者 https://www.devze.com 2023-02-09 17:48 出处:网络
Is it possible to get the datatype of the column from the stored procedure in ado.net environment. Suppose I have defined a table with say name andid. Say name is having a datatype of varchar(20), an

Is it possible to get the datatype of the column from the stored procedure in ado.net environment.

Suppose I have defined a table with say name and id. Say name is having a datatype of varchar(20), and id is of type int.

Now from the ado.net prespective when I do a Exec开发者_如何学JAVAuteReader, is it possible to know the datatypes of the columns?

Any sample/pseudo code or link will be helpful

Thanks


It's been a while since I did anything like this, but ISTR that the ExecuteReader gives you a SQLDataReader object. That object has a GetDataTypeName method that returns a string with the type of the column.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号