Re: SQLce 3.5 databound to C# 2008 control

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Stephen,

I wouldn't worry about referencing a single dataset from several places. The memory used by the dataset won't be released until there are no longer any active references to it anywhere, but the reference itself is just a pointer.

I think if you watch that video you'll get a good idea how the databound controls work with SQL Compact and VS 2008, even if you don't need to use Sync Services at the moment. If you have more questions after viewing it, just ask.

--
Ginny Caughey
Device Application Development MVP

www.wasteworks.com
Scalehouse and Billing Software for Waste Management



"Stephen Reilly" <StephenReilly@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:923D4B12-B6A1-4980-B692-EC38163A2F5B@xxxxxxxxxxxxxxxx
Ginny,

thanks for the quick reply.

Most of the demos I've seen do use a single DataSet rather than a separate
one for each table, although you could do it either way. I imagine there is
Grand so. I was worried that referencing the full dataset on each form even
though I may only need to retrieve a single field might have been overkill.
I'll have to read up more on how they access and store the data while in use.

some overhead to having multiple DataSets. You do need need to call the
TableAdapter.Fill method for each table, and the form Load event handler is
usually where people do that. The code generated by the Data Source tool in
VS 2008 already wired up the connection between specific table adapters and
GUI controls for you, but if you didn't use those tools, you'd need to
establish the data binding programmaticly.
I went back and dragged a field (set as a combobox) from the DataSource list
onto a form. When I previewed the data again the table was correctly returned
but when I ran the form the control was empty. I tried this with and without
the databound options set on the control. It would save heaps of time if I
could get a few forms working this way.

If you're interested in experimenting, you might enjoy trying Sync Services
for ADO.NET if this is a desktop app. (If it's a device app, that isn't an
That looks really interesting, thanks for the link. It would have saved bags
of code a few years ago :)

Stephen

.



Relevant Pages

  • Re: Primary key ContactID not migrating to subforms
    ... I am pretty sure if you don't have any bound controls on sfrmEstimate, just an unbound one referencing the Contacts form's ContactID value, you would be able to get away with no record source on the subform. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Where are docs for Forms Object Model
    ... See the entry for "Accessing Controls Through the Controls Collection ... The Pages collection is actually retrieved through the Outlook VBA Inspector ... > mentioned in the docuemtation for the CustomPropertyChange event. ... > referencing a specific control on a form, as such it seems pretty important ...
    (microsoft.public.outlook.program_vba)
  • Re: Sum of field in a sub forms
    ... The general expression for referencing forms and controls is as follows: ... Please note the Period between MySubform and Form -- this is really important. ...
    (microsoft.public.access.forms)
  • Re: Variable question.
    ... referencing the Controls collection. ... This can still be done within a loop, ... Either that or make sure TextNWS, et al are declared as Controls and then ...
    (microsoft.public.access.formscoding)
  • Re: OpenNETCF.Desktop.Communication.dll
    ... No, as it's definitely valid. ... You're referencing it from a Desktop app, ... Chris Tacke ...
    (microsoft.public.dotnet.framework.compactframework)