System.Data.Datarow C# error

后端 未结 6 615
傲寒
傲寒 2021-01-19 04:06

So I\'m in the verge of creating my first C# system. I use my vb.net system to use as my reference.

This is the code on my vb.net system:

Dim value A         


        
6条回答
  •  悲哀的现实
    2021-01-19 04:45

    int value = int.Parse(dt.Rows[0]["TransID"]);
    

    or you can also use column index if you know it:

    Assuming that required column is 3rd column in the datatable:

      int value = int.Parse(dt.Rows[0][2]);
    

提交回复
热议问题