How can you convert “tinyint” of t-sql to integer in c#?

后端 未结 4 618
日久生厌
日久生厌 2020-12-04 23:06

I have a tinyint column in the database and I wish to convert it to Int32 for an SqlDataReader.

How do i go about it?

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-05 00:03

    int RetValue;
    RetValue = (int)(byte)dt.Rows[A][B]  // A = RowNo , B = 'tinyint' Column Name.
    

提交回复
热议问题