Sunday 15 May 2011

sql server - What is TSQL TinyInt in C#? -



sql server - What is TSQL TinyInt in C#? -

this question has reply here:

how can convert “tinyint” of t-sql integer in c#? 5 answers

i'm puzzled cast in c# create query t-sql returns tinyint.

using sqldatareader...

int precision = 0; sqldatareader reader = mycommand.executereader(); if (reader.read()) { precision = reader.getint16(0); }

i'm getting invalidcastexception when utilize getint16, , that's smallest integer cast apparently available. in same code cast smallint int16.

what get.... utilize tinyint?

edited add:

an reply subsequently deleted said utilize getbyte. did, , worked.

as mentioned in this documentation short when mapping sql clr.

c# sql-server tsql

No comments:

Post a Comment