Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 180777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:38:45+00:00 2026-05-11T14:38:45+00:00

OK – I have worded this search 40 different ways and I seem to

  • 0

OK – I have worded this search 40 different ways and I seem to be lost here.

Every example I find seems so happy that you can easily drag and drop a datagrid and let the user fill it in — then they stop! I know how to do everything I am asking through LINQ. That obviously won’t translate here. I really should have learned ADO.NET first, then LINQ, but NOoooo…

I need to know how to do the following in .NETCF (Windows Mobile 5) using a SQL CE database on the device.

  1. Add a new record and populate some or all of the fields with data I supply. I don’t need to add a record to a datagrid – sometimes the user will not even see the record. How do I add a new record — put data into it and save it? For example: Create a new delivery record, say, and have the program store the date in one field and a number in another field.

  2. Search for a record, then update data in it. Again, using LINQ I can do this easily — I cannot for the life of me find any examples of doing it without it. I can find lots of examples of populating a grid of databound fields, letting the user make changes then saving it out. I don’t need to do that.

Say I need to search for the one record that meets a criteria (customerID=10 and orderID=1234), then when (if) that record is found, update a field in it.

Please let me know if you need any more info. I have done a lot of reading and just seem to be missing something!

Thanks in advance…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T14:38:46+00:00Added an answer on May 11, 2026 at 2:38 pm

    For #1, there are a few ways. Two easy, common ways are:

    Use a SqlCeResultset, and create a row with it, then insert.

    using(SqlCeConnection connection = new SqlCeConnection(myConnString)) using (SqlCeCommand cmd = new SqlCeCommand()) {     connection.Open();     cmd.CommandText = 'MyTable';     cmd.CommandType = CommandType.TableDirect;     cmd.Connection = Connection;     SqlCeResultSet rs = cmd.ExecuteResultSet(ResultSetOptions.Updatable);      SqlCeUpdatableRecord record = rs.CreateRecord();      // do something to set your values in the record      rs.Insert(record); } 

    Use a SqlCeCommand, set the command SQL and call ExecuteNonQuery.

    using (SqlCeConnection connection = new SqlCeConnection(myConnString)) using (SqlCeCommand cmd = new SqlCeCommand()) {     connection.Open();     cmd.CommandText = 'INSERT INTO MyTable(Foo) VALUES('bar')';     cmd.CommandType = CommandType.Text;     cmd.Connection = Connection;     cmd.ExecuteNonQuery(); } 

    For #2 it’s not much different. Use an updateable resultset, seek to the record, modify and call Update or build your SQL and send it through the command using ExecuteScalar or ExecutNonQuery. The code is similar enough to those above that I’ll leave it to you to work out.

    A quick search on ‘SqlCeResultSet’ and ‘example’ or ‘update example’ give loads of relevant results.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Simple.Data and have been trying to find an example that will
This could be a duplicate question, but I have no idea what search terms
We have a title <title>Text &#8211; text</title> I want to change it with jquery
i have this code: <?php $valid_ext = array(pdf, doc); $args = array( 'post_type' =>
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
My NSXMLParser breaks on this string: <title>AAA &#8211; BCDEFGQWERTYUIO</title> I parsed it in this
We have different types of hyphens/dashes (in some text) populated in db. Before comparing
Have a webpage that will be viewed by mainly IE users, so CSS3 is
So to start, I have an array of XML files. These files need to
Here is the link to the offending page: http://www.wrightspecialty.com/brokers-agents-questionnaire.html?view=foxcontact There's a limitation to the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.