I am recieving this error: 'System.Web.UI.Control' does not contain a definition for 'DataItem'
What iam trying to do is when a user clicks the hyperlink column in the datagrid then the ID of that user is send to another page and I need to run the Query or something and bind the Label on the page 2 with the name of the Person. So I am using the HTML view and writing something like this :
'<%# DataBinder.Eval(Container.DataItem,"Name") %> '
here is my code behind file so how can i bind the Name of the person with the label:
private void Page_Load(object sender, System.EventArgs e)
// Checks to see if the Request Query String was not null
if(Request.QueryString["CustomerID"] != null)
int CustomerID = Convert.ToInt32(Request.QueryString["CustomerID"]);
//Label1.Text = CustomerID;
OleDbDataAdapter ad1 = new OleDbDataAdapter("SELECT * FROM Customers WHERE CustomerID="+CustomerID,myConnection);
OleDbDataAdapter ad2 = new OleDbDataAdapter("SELECT * FROM Purchases WHERE CustomerID="+CustomerID,myConnection);
DataSet ds1 = new DataSet();
DataSet ds2 = new DataSet();
CustomerGrid.DataSource = ds1;
BooksGrid.DataSource = ds2;
Wanna get high!