M
matteo
Hi everybody,
i've a question for this group: i've developed a windows service that
every x minutes count records present in a sql table and if those
records are bigger than a fixed threshold start with clean operations.
Workflow is this:
1) Load records in a DataSet:
DataSet ds = new DataSet();
cmd = "SELECT * FROM " + TableName;
.........
adapter.Fill( ds );
2)Generate a DataView form table inside dataset and order it (i must
order. I tryed to order before load table in DataSet, but table is very
big and often i had timeout)
DataView dv = new DataView(ds.Tables[0]);
string order = GetTimeFieldName ( Table ) + " ASC";
dv.Sort = order;
3) Now i need convert data to XML, but not only one XML file, N XML
file of 10000 records. To do this i generate N DataTable from DataView,
add each DataTable to a New DataSet and call
WriteXML method N time.
The workflow working fine, but i think is not optimal solution (load
dataset, copy to dataview, order dataview, copy again ....... ) ,
someone have a better idea, or some suggestion to gave me?
i've a question for this group: i've developed a windows service that
every x minutes count records present in a sql table and if those
records are bigger than a fixed threshold start with clean operations.
Workflow is this:
1) Load records in a DataSet:
DataSet ds = new DataSet();
cmd = "SELECT * FROM " + TableName;
.........
adapter.Fill( ds );
2)Generate a DataView form table inside dataset and order it (i must
order. I tryed to order before load table in DataSet, but table is very
big and often i had timeout)
DataView dv = new DataView(ds.Tables[0]);
string order = GetTimeFieldName ( Table ) + " ASC";
dv.Sort = order;
3) Now i need convert data to XML, but not only one XML file, N XML
file of 10000 records. To do this i generate N DataTable from DataView,
add each DataTable to a New DataSet and call
WriteXML method N time.
The workflow working fine, but i think is not optimal solution (load
dataset, copy to dataview, order dataview, copy again ....... ) ,
someone have a better idea, or some suggestion to gave me?