Click here to Skip to main content
15,919,774 members
Home / Discussions / C#
   

C#

 
AnswerRe: DateTime Problem Pin
Vikram A Punathambekar16-Jul-07 0:30
Vikram A Punathambekar16-Jul-07 0:30 
AnswerRe: DateTime Problem Pin
T1TAN16-Jul-07 23:14
T1TAN16-Jul-07 23:14 
QuestionPopulate a *.sdf database from a dataset Pin
pmartike15-Jul-07 23:25
pmartike15-Jul-07 23:25 
AnswerRe: Populate a *.sdf database from a dataset Pin
Colin Angus Mackay16-Jul-07 0:15
Colin Angus Mackay16-Jul-07 0:15 
GeneralRe: Populate a *.sdf database from a dataset Pin
pmartike16-Jul-07 0:44
pmartike16-Jul-07 0:44 
GeneralRe: Populate a *.sdf database from a dataset Pin
Mike Dimmick16-Jul-07 0:59
Mike Dimmick16-Jul-07 0:59 
GeneralRe: Populate a *.sdf database from a dataset Pin
Colin Angus Mackay16-Jul-07 2:29
Colin Angus Mackay16-Jul-07 2:29 
AnswerRe: Populate a *.sdf database from a dataset Pin
Mike Dimmick16-Jul-07 0:55
Mike Dimmick16-Jul-07 0:55 
For SQL Server 2005 Mobile Edition/SQL Server CE 3.1, with .NET Compact Framework 2.0, you can manipulate the tables directly (as it's an in-process database engine).

Open a SqlCeResultSet directly on the table you want to insert into. Use the CreateRecord method to get a SqlCeUpdatableRecord, which you set the properties of. Then use the resultset's Insert method to update the table. Reportedly, this is much faster than using any SQL INSERT query, even if you Prepare the command object.

In fact SQL Server CE is reportedly much faster if you manipulate tables directly and use the navigation methods on SqlCeResultSet or SqlCeDataReader than using any form of SQL. Only use a SELECT query when you want to do a complicated join.

You can open an updatable resultset directly on a table by doing:
using( SqlCeCommand cmd = new SqlCeCommand( "MyTable", conn ) )
{
   cmd.CommandType = CommandType.TableDirect;
 
   using( SqlCeResultSet rs = 
      cmd.ExecuteResultSet( ResultSetOptions.Updatable ) )
   {
      // code to manipulate the resultset
   }
}
Note that this is unique to SQL Server CE - you cannot open tables directly with the full SQL Server 2000 or 2005.

Stability. What an interesting concept. -- Chris Maunder

GeneralRe: Populate a *.sdf database from a dataset Pin
pmartike16-Jul-07 3:08
pmartike16-Jul-07 3:08 
GeneralRe: Populate a *.sdf database from a dataset Pin
Mike Dimmick16-Jul-07 6:04
Mike Dimmick16-Jul-07 6:04 
QuestionXAML How to get parent property Pin
Juan Pablo G.C.15-Jul-07 23:18
Juan Pablo G.C.15-Jul-07 23:18 
AnswerRe: XAML How to get parent property Pin
snorkie16-Jul-07 3:10
professionalsnorkie16-Jul-07 3:10 
Questionjava script Pin
kalyan_241615-Jul-07 23:08
kalyan_241615-Jul-07 23:08 
AnswerRe: java script Pin
Nouman Bhatti15-Jul-07 23:20
Nouman Bhatti15-Jul-07 23:20 
QuestionCustom stored procedure in netTiers Pin
thuannguyen15-Jul-07 22:15
thuannguyen15-Jul-07 22:15 
AnswerRe: Custom stored procedure in netTiers Pin
Vasudevan Deepak Kumar15-Jul-07 22:39
Vasudevan Deepak Kumar15-Jul-07 22:39 
Questionhow to set the number of rows in listview in c# Pin
monuSaini15-Jul-07 22:10
monuSaini15-Jul-07 22:10 
AnswerRe: how to set the number of rows in listview in c# Pin
Eduard Keilholz15-Jul-07 22:48
Eduard Keilholz15-Jul-07 22:48 
AnswerRe: how to set the number of rows in listview in c# Pin
mav.northwind16-Jul-07 3:34
mav.northwind16-Jul-07 3:34 
QuestionAccessing the program folder Pin
AlexZieg7115-Jul-07 22:01
AlexZieg7115-Jul-07 22:01 
AnswerRe: Accessing the program folder Pin
Vasudevan Deepak Kumar15-Jul-07 22:41
Vasudevan Deepak Kumar15-Jul-07 22:41 
GeneralRe: Accessing the program folder Pin
AlexZieg7115-Jul-07 23:22
AlexZieg7115-Jul-07 23:22 
GeneralRe: Accessing the program folder Pin
AlexZieg7116-Jul-07 0:09
AlexZieg7116-Jul-07 0:09 
GeneralRe: Accessing the program folder Pin
mav.northwind16-Jul-07 10:04
mav.northwind16-Jul-07 10:04 
GeneralRe: Accessing the program folder Pin
AlexZieg7116-Jul-07 10:09
AlexZieg7116-Jul-07 10:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.