Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11508

getting a column's value from a DataTable using c#

$
0
0

Hi,

I have populated a datatable from sharepoint list which has 1 row and 2 columns. I want to put value of the second column (ID) in to the batch parameter of UpdateListItem(). here is my batch

stringBatch="<Method ID='1' Cmd='Update'>"+"<Field Name='ID'>30</Field>"+"<Field Name='PName'>AAA</Field>"+"<Field Name='code'>000</Field></Method>";

here i have tried passing the ID column with hard coded value. However I have to populate this value programatically. For this I have pulled ID column's values in a datatable. Now I want to use this value in place of hard coded one.

stringBatch="<Method ID='1' Cmd='Update'>"+"<Field Name='ID'>"+ value +"</Field>"+"<Field Name='PName'>AAA</Field>"+"<Field Name='code'>000</Field></Method>";
How can I get 2nd column's value of the only row in the datatable?

Viewing all articles
Browse latest Browse all 11508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>