B
Boas Enkler
Hi
I found this code here :
cmd.CommandText = "SELECT * FROM myTable";
SqlCeResultSet rs = cmd.ExecuteResultSet(ResultSetOptions.Updatable |
ResultSetOptions.Scrollable);
// Add a record
SqlCeUpdatableRecord rec = rs.CreateRecord();
// Insert values into the 3 fields
rec.SetInt32(0, 34);
rec.SetDecimal(1, (decimal)44.66);
rec.SetString(2, "Sample text");
rs.Insert(rec);
According to an situation I've in my application I got some questions
and I hope someone may help me
As background information: As part of an synchronisation process the
Insert method could fire about 30.000 times in a row. So I search each
possibility to improve this process.
wouldn't it better to set "Select * from myTable where 1=2" when I just
use the Result set for inserts? So I just would get the structure and no
data?
Whats the better practive to use SetString or SetSqlString ?When is
which best?
Should I create everytime a new SqlCeUpdateableRecord or may I stored it
in an class propertie and just assign new values each time? So I would
save time for the new() command, wouldn't I ? Same for SqlCeResultSet ?
Are there anymore ways to improve insert times ?
Thanks in advance!
I found this code here :
cmd.CommandText = "SELECT * FROM myTable";
SqlCeResultSet rs = cmd.ExecuteResultSet(ResultSetOptions.Updatable |
ResultSetOptions.Scrollable);
// Add a record
SqlCeUpdatableRecord rec = rs.CreateRecord();
// Insert values into the 3 fields
rec.SetInt32(0, 34);
rec.SetDecimal(1, (decimal)44.66);
rec.SetString(2, "Sample text");
rs.Insert(rec);
According to an situation I've in my application I got some questions
and I hope someone may help me
As background information: As part of an synchronisation process the
Insert method could fire about 30.000 times in a row. So I search each
possibility to improve this process.
wouldn't it better to set "Select * from myTable where 1=2" when I just
use the Result set for inserts? So I just would get the structure and no
data?
Whats the better practive to use SetString or SetSqlString ?When is
which best?
Should I create everytime a new SqlCeUpdateableRecord or may I stored it
in an class propertie and just assign new values each time? So I would
save time for the new() command, wouldn't I ? Same for SqlCeResultSet ?
Are there anymore ways to improve insert times ?
Thanks in advance!