如何将Datarow转换为int? (C ++ / CLI)

时间:2022-09-01 23:25:52

I have a datarow, but how can i convert it to an int or byte ?

我有一个datarow,但我怎么能将它转换为int或byte?

DataRow^ rw = dt->Rows[1];
printf("ID = %d \n", rw->ItemArray->GetValue(1)->ToString());

ItemArray->GetValue(1) is tinyint to sql database.

ItemArray-> GetValue(1)对于sql数据库来说是tinyint。

1 个解决方案

#1


0  

I Found it.

我找到了。

DataRow^ rw = dt->Rows[1];
Byte ^ temp=(Byte^)rw->ItemArray->GetValue(5);
printf("ID = %d \n",*temp);

#1


0  

I Found it.

我找到了。

DataRow^ rw = dt->Rows[1];
Byte ^ temp=(Byte^)rw->ItemArray->GetValue(5);
printf("ID = %d \n",*temp);