How to Convert the value in DataTable into a string array in c#

前端 未结 6 1177
灰色年华
灰色年华 2020-12-16 00:26

I have a DataTable that contains a single row. I want to convert this DataTable values into a string array such that i can access the column values of that DataTable through

6条回答
  •  醉梦人生
    2020-12-16 01:11

    If that's all what you want to do, you don't need to convert it into an array. You can just access it as:

    string myData=yourDataTable.Rows[0][1].ToString();//Gives you USA
    

提交回复
热议问题