Note that there are some explanatory texts on larger screens.

plurals
  1. POUpdate big table (a lot of columns). C# .NET
    primarykey
    data
    text
    <p>I have to update a big table with over 270 update fields.</p> <p>I am relative new to .NET and need advise what is better to use in this case: SqlCommand, some kind of memory-mapped table or DataSet or maybe it exists some kind of auto-generated objects using meta-data from DB? Please help.</p> <p>Reason: I have an old big Delphi7 application, a part of which is responsible for listening on socket some packets which are marshaled to big structures and, in final step, stored in DB. Now I am porting this part to new C# Service and at least actually i have to preserve the same logic. The problem is that structure is BIG (over 220 fields) and tables where it is stored have near 300 fields. From my structure of 220 fields are deducted/calculated other ~50 fields and all should be update in DB. Actual Delphi code is ugly ant it grew over several years like table itself, something like this: </p> <pre><code>'UPDATE TABLE_NAME ' + ' MSG_TYPE = ' + IntToStr(integer(RecvSruct.MSG_TYPE)) + ' ' + ' ,SomeFLOATfield = ' + FloatToStr(RecvSruct.SomeFLOATfield) + ' ' + ... //and other over 270 fileds here 'WHERE ID = ' + IntToStr(obj.ID) </code></pre> <p>no any dynamic SQL, etc.. Actually I cannot change DB structure.. so that i have to play in code only and I am not sure if it is pertinently to translate code. Table is used for some reports and statistics. Some of calculated/deducted fields have to deal with some constants in source-code.</p> <p>used dev-tools: MS SQL Server 2000, C# .net2.0, VS2008</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload