Error in code using Dataview to obtain values from a table .

Posted by Anishabathija under ASP.NET on 1/16/2013 | Points: 10 | Views : 425 | Status : [Member] | Replies : 0
My code is as below :

DataView productstable = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty); //select statements returns a IEnumerable and we must convert it to dataview//
productstable.RowFilter = " ProductID = '" + ddlProduct.SelectedValue + "'";
DataRowView row = (DataRowView) productstable[0];

Products p = new Products();
p.ProductID = row["ProductID"].ToString();

I'm getting the below error :

'ShoppingClass.Products' does not contain a definition for 'ProductID' and no extension method 'ProductID' accepting a first argument of type 'ShoppingClass.Products' could be found (are you missing a using directive or an assembly reference?)

How Can i solve this issue .


(No response found.)

Login to post response