English 中文(简体)
你们怎样才能将“持续”的t-sql转换为c#中的分类。
原标题:How can you convert "tinyint" of t-sql to integer in c#?

页: 1 数据库一栏,我希望将其改为Int32,用于

怎么办?

www.un.org/Depts/DGACM/index_spanish.htm Edit #1

我最近不得不这样做。

int a = dataReader.GetByte(dr.GetOrdinal("ColumnName"));

http://www.ohchr.org。

服务器数据类型绘图

bigint           - GetInt64  
binary           - GetBytes  
int              - GetInt32  
money            - GetDecimal  
rowversion       - GetBytes  
smallint         - GetInt16  
tinyint          - GetByte  
uniqueidentifier - GetGuid   
...

For more info visit - 服务器数据类型绘图

最佳回答

通常会回过来的是: 如果是的话,只是一箱子,然后转换:

(int)(byte) reader["column"];

或只是让转换自然发生:

int x = (byte) reader["column"];

或与严格分类的方法相同:

int x = reader.GetByte(column);

将这一条改为<代码>sbyte或short 或者,如果我错把它绘制成<条码>,则无论怎样。 你可以在服务器一侧进行转换,但我个人在客户方面这样做,并保持车轮。

问题回答

使用“普通”处理锡奈特问题

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

a. 从一片纸张桌上提取一个小int:

retorno = Convert.ToInt32(dr.GetByte(dr.GetOrdinal("StepStatus")));

如果重新编号为无固定变量。

我希望你能这样做。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签