You cannot use a class with
using
which basically defines just a 'shortcut' to a namespace, like
imports
in VB.
Instead you define a variable which holds an instance of the class and assign an instance to it.
An example from
MSDN[
^]:
private void MakeDataTableAndDisplay()
{
DataTable table = new DataTable();
DataColumn column;
DataRow row;
column = new DataColumn();
column.DataType = System.Type.GetType("System.Int32");
column.ColumnName = "id";
table.Columns.Add(column);
column = new DataColumn();
column.DataType = Type.GetType("System.String");
column.ColumnName = "item";
table.Columns.Add(column);
for(int i = 0; i < 10; i++)
{
row = table.NewRow();
row["id"] = i;
row["item"] = "item " + i;
table.Rows.Add(row);
}
dataGrid1.DataSource = table;
}