cancel
Showing results for 
Search instead for 
Did you mean: 

Using c# in Code block

vignesh_sundar
Level 3
I tried using c# in code block. It was working fine when i tried assigning simple string variables. But when i try to create a Collection or a datatable and assign it to a variable I'm getting few errors such as System.ComponentModel.MarshalByValueComponent is in a assembly that is not referenced. System.ComponentModel.IListSource is in a assembly that is not referenced. System.ComponentModel.ISupportIniatializeNotification is in a assembly that is not referenced. Code Block DataTable table = new DataTable(); table.Columns.Add("Dosage", typeof(int)); table.Columns.Add("Drug", typeof(string)); table.Columns.Add("Patient", typeof(string)); table.Columns.Add("Date", typeof(DateTime)); table.Rows.Add(25, "Indocin", "David", DateTime.Now); table.Rows.Add(50, "Enebrel", "Sam", DateTime.Now); table.Rows.Add(10, "Hydralazine", "Christoff", DateTime.Now); table.Rows.Add(21, "Combivent", "Janet", DateTime.Now); table.Rows.Add(100, "Dilantin", "Melanie", DateTime.Now); Output = table;
2 REPLIES 2

AlainAlmeida
Level 3
You need to Add External Reference to the appropiate .NET dll, in your case is System.dll

In this case if i add an external reference to mscorlib.dll, I'm getting a new error ""An assembly with the same identity exists. Try removing the duplicate reference"".