Ramakrishnan Nagarajan wrote:
Hi can any one help me in converting a DataView into a DataSet or a DataTable
into a DataSet,
I tried the following ways
dSet= ((DataSet)_gridRegStudDetails.DataSource);
dSet = ((DataSet)_gridRegStudDetails.DataSource).Tables[0].DataSet;
studData = ((DataSet)dView).Tables[0].DataSet;
But not working
can you pls help me out
Thanks in advance,
N.Ramakrishnan
You don't convert a datatable to a dataset. You add a table to a dataset.
From the help file under: DataSet Class, adding DataTable
Dim custDS As DataSet = New DataSet("CustomerOrders")
Dim ordersTable As DataTable = custDS.Tables.Add("Orders")
Dim pkCol As DataColumn = ordersTable.Columns.Add("OrderID",
Type.GetType("System.Int32"))
ordersTable.Columns.Add("OrderQuantity", Type.GetType("System.Int32"))
ordersTable.Columns.Add("CompanyName", Type.GetType("System.String"))
ordersTable.PrimaryKey = New DataColumn() {pkCol}
Chris