matthewking
Programmer
Hi,
I have the following code, and im getting this error on the line that creates a new DataTable object:-
System.Data.DataTable denotes a class which is not valid in the given context.
I've commented alot out trying to find the error, but it persists. Anyone have any ideas?
code:-
using System;
using System.Data;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Spanish.Web.Components;
// <summary>
// Codebehind for VerbGrid.ascx
// </summary>
namespace Spanish.Web.Controls.Codebehind
{
public class VerbGrid : System.Web.UI.UserControl
{
public DataTable objDataTable;
public DataRow objDataRow;
public System.Web.UI.WebControls.DataGrid dg;
public void Page_Load(object sender, System.EventArgs e)
{
//createTable();
//populateTable();
//dg.DataSource = objDataTable;
//dg.DataBind();
}
public void createTable()
{
objDataTable = DataTable("Verbs"
//objDataTable.Columns.Add("VerbID", GetType(Integer));
//objDataTable.Columns.Add("Active", GetType(Integer));
//Session("Verbs" = objDataTable;
}
public void populateTable()
{
//objDataTable = Session("Verbs"
for(int i = 0; i <= 8; i++)
{
//objDataRow = objDataTable.NewRow();
verb myVerb = new verb();
//objDataRow("VerbID".Value = (int) myVerb.verbID;
//objDataRow("Active".Value = (int) 1;
//objDataTable.Rows.Add(objDataRow);
}
}
}
}
I have the following code, and im getting this error on the line that creates a new DataTable object:-
System.Data.DataTable denotes a class which is not valid in the given context.
I've commented alot out trying to find the error, but it persists. Anyone have any ideas?
code:-
using System;
using System.Data;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Spanish.Web.Components;
// <summary>
// Codebehind for VerbGrid.ascx
// </summary>
namespace Spanish.Web.Controls.Codebehind
{
public class VerbGrid : System.Web.UI.UserControl
{
public DataTable objDataTable;
public DataRow objDataRow;
public System.Web.UI.WebControls.DataGrid dg;
public void Page_Load(object sender, System.EventArgs e)
{
//createTable();
//populateTable();
//dg.DataSource = objDataTable;
//dg.DataBind();
}
public void createTable()
{
objDataTable = DataTable("Verbs"
//objDataTable.Columns.Add("VerbID", GetType(Integer));
//objDataTable.Columns.Add("Active", GetType(Integer));
//Session("Verbs" = objDataTable;
}
public void populateTable()
{
//objDataTable = Session("Verbs"
for(int i = 0; i <= 8; i++)
{
//objDataRow = objDataTable.NewRow();
verb myVerb = new verb();
//objDataRow("VerbID".Value = (int) myVerb.verbID;
//objDataRow("Active".Value = (int) 1;
//objDataTable.Rows.Add(objDataRow);
}
}
}
}