Is it possible to know the datatype of the column returned from Stored Proc records set from ado.net
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.
精彩评论