Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

What do I need to make this class to be able to Send Updates back to SQL Server?

$
0
0

Hi everybody,

We have the following class:

public class DataTableHelper { public Int32 RecordCount { get { if (null == table) return 0; else return table.Rows.Count; } //private set { } - no need for set as this property makes sense as get only } public DataTable table; //===================================================================================================================== public DataTableHelper() { } //===================================================================================================================== public DataTableHelper(SqlCommand toSqlCommand) { ProcessDataTable(toSqlCommand); } //===================================================================================================================== public Boolean Populate(SqlCommand toSqlCommand) { return ProcessDataTable(toSqlCommand); } //===================================================================================================================== public MWDataRow GetDataRow(Int32 tnRowNumber = 0) { return new MWDataRow(table, tnRowNumber); }

...

}

The way it's currently used is we pass SQL command that returns just one row.

I want to be able to update that row and send back changes to SQL Server.

My question is - would it be somehow possible directly with that class? In the VFP code I am trying to translate we open the table in the buffered mode, do many replaces, then at the end of the process we perform TableUpdate that sends changed information back to the database. 

So, here I want to somehow be able to set columns to new values and also send the updates by one command.

Do you have suggestions for me as what should I add to the class above to be able to do what I need?

Thanks a lot in advance.


For every expert, there is an equal and opposite expert. - Becker's Law


My blog


My TechNet articles



Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>