Community

Scripting - IDataSet Answered

Hello, 

I have made a DataSet inside Flexicapture called "ItemsToChange". I've added in 3 columns and inserted 5 rows. 

I now want to create a script in C# .NET to access the 5 rows I created. I have figured out how to get the total rows inside the DataSet but I'm not able to get the values. I've read the help file on the website and that didn't help. I also have been trying to find an example, but failed to do so. 

 

If possible can you please provide an example of how you would do this.

 

How I'm accessing the DataSet = 

IDataSet ds = Context.DataSet("ItemsToChange");

IDataSetQuery dsQuery = ds.CreateQuery();

int RecordsInDs = ds.GetRecordsCount(dsQuery);

//Loop through the DataSet to retrieve rows

for(int i = 0;i < RecordsInDs;i++)

   IDataSetRecord dsRecord = ???

Was this article helpful?

0 out of 0 found this helpful

Comments

1 comment

  • Avatar
    Permanently deleted user

    Hello,

    Here is the sample code:

    DataSet dataSet = Context.DataSet("ItemsToChange");

    IDataSetQuery query = dataSet.CreateQuery();

    IRecordset recordSet = dataSet.GetRecords(query);

    for (int i = 0; i < recordSet.Count; i++)

    {

        record = recordSet.GetRecord(i);

        string fullName = record.GetValue(0).ToString();

    }

    0

Please sign in to leave a comment.