C#
codice:DataTable table = new DataTable(); DataColumn col1 = new DataColumn("ID"); DataColumn col2 = new DataColumn("Name"); DataColumn col3 = new DataColumn("Checked"); col1.DataType = System.Type.GetType("System.Int"); col2.DataType = System.Type.GetType("System.String"); col3.DataType = System.Type.GetType("System.Boolean"); table.Columns.Add(col1); table.Columns.Add(col2); table.Columns.Add(col3); DataRow row = table.NewRow(); // << E' qui che sbagli row[col1] = 1100; row[col2] = "Computer Set"; row[col3] = true; table.Rows.Add(row);

Rispondi quotando