Hi Melvik,
Yes I did.
But I still got the error:
error CS0122: 'System.Data.DataView.sort' is inaccessible due to its protection level
Here is my whole code for that section:
public void BindDataGrid()
{
LabelMessage.Visible = false;
MyConn = new SqlConnection (conString);
String sqlSelect = "select ProductID, ProductDescr, SupplierID, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued, Picture, PictureType from TblProduct";
SqlDataAdapter cmdSelect = new SqlDataAdapter (sqlSelect, MyConn);
//Create a dataset and fill it with the data
DataSet ds = new DataSet();
cmdSelect.Fill(ds, "DEProduct");
DataTable prodTable = ds.Tables["DEProduct"];
if (InsertFlag)
{
InsertFlag = false;
DataRow row = prodTable.NewRow();
prodTable.Rows.Add(row);
}
DataView prodView = prodTable.DefaultView;
prodView.sort = "ProductID";
DataGridDEProduct.DataSource=prodView;
DataGridDEProduct.DataBind() ;
}
Can you see anything wrong?
Thanks.
Vivi
|