Page 1 of 1

Adding new DataTable and DataSet

Posted: Mon Oct 01, 2012 10:11 am
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

Re: Adding new DataTable and DataSet

Posted: Tue Jan 21, 2020 12:17 pm
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;