Adding new DataTable and DataSet

A forum devoted to the discussion of all topics having to do with scripting and other advanced programming using iX Developer.
Post Reply
wlederer
Posts: 175
Joined: Fri Jan 27, 2012 4:20 am

Adding new DataTable and DataSet

Post by wlederer »

We can create a DataTable by adding the new Datalogger.
But, how can we do it with a script?
And how to create a DataSet?
Regards, Waldemar

User avatar
Russ C.
Posts: 213
Joined: Thu Nov 16, 2017 3:32 pm
Contact:

Re: Adding new DataTable and DataSet

Post by Russ C. »

You can use DataTables in Scripting:

Code: Select all

 DataTable test = new DataTable();
			test.Clear();
			test.Columns.Add("Motor");
			test.Columns.Add("RPM");
			DataRow motor1 = test.NewRow();
			DataRow motor2 = test.NewRow();
			motor1 ["RPM"]= 5600;
			motor1 ["Motor"]= "Motor 1";
			test.Rows.Add(motor1);
			motor2 ["RPM"]= 7200;
			
			motor2 ["Motor"]= "Motor 2";
			test.Rows.Add(motor2);
			
			DataGrid_2.DataSource = test;
Best regards,

Russ
(801) 708-6690
Technical Support
Contact Us

Beijer Electronics AB
http://www.beijerelectronics.us

Post Reply