Some questions about databases supprt

  • Thread starter Thread starter tiger79
  • Start date Start date
T

tiger79

Hi,
I have read some info about the CF support for databases. Especially SQL
seems supported well... Only the whole idea is based on the idea of
connectionless which is naice but it also means that the ppc has to make
conrtact with an sql database server at some point... That is a problem for
me...
I'd like to know if its possible to have a database file stored locally on
the ppc (preferably a .mdb, if no other option a sql) and to use parts of
the information stored in the file (using querys) to fill a treeview or a
listbox...
And if this is possible is there some tutorial or so ??? I know that C# is
capable of accessiing access files (funny) but I can't seem to find if its
possible with the CF ???
Thanx for the help !
 
Well it is possible but the compact framework doesnt support pocket access,
only SQLCE , which isnt a complete bad thing :)

Peter Foot has written a wrapper which will give you the functionality,
information and example can be found here
http://www.devbuzz.com/content/zinc_dotnet_pocket_access_pg1.asp

SQLCE can live quite happily without ever talking to an SQLServer, and
infact if you do there is licensing issues you will need to be aware of.

- James McCutcheon
 
tiger79 said:
Hi,
I have read some info about the CF support for databases. Especially SQL
seems supported well... Only the whole idea is based on the idea of
connectionless which is naice but it also means that the ppc has to make
conrtact with an sql database server at some point... That is a problem for
me...

To have a data driven app, you'll need a datasource in some form or another.
That source can exists on a network, (A Sql Server for instance), the web
like a XML Web Service, an XML File located locally or on a network or a
database on the PDA like Sql Server CE or similar product.
I'd like to know if its possible to have a database file stored locally on
the ppc (preferably a .mdb, if no other option a sql) and to use parts of
the information stored in the file (using querys) to fill a treeview or a
listbox...

Yes, abosolutely. You can use SQL Server CE as one approach and you don't
have to use it in conjunction with the Desktop SQL SErver although that
certianly provides many benefits. In your case you think that's not doable.
Ok, but you can still use CE locally on your PDA. You can also use XML and
datasets, using DataSet.WriteXML on the desktop or wherever to serialize
your XML File, then transfer it, then use myDataSet =
SomeDataSet.ReadXML(@"\Storage Card\whatever.xml") or whatever file you
want. You can also use SQL CE like I mentioned or Pocket Access although if
you use POcket access you'll need a product like www.inthehand.com 's ADOCE
wrapper (which is a super good deal on it). Loading controls like a Treeview
involve iterating through your datasource and adding itmes/subitems while
you can use databinding with the listbox ... listbox.DataSource =
someDataSet.Table[0];
listbox.DisplayMember= "FieldNameYouWantShownInListBox";
listbox.ValueMemeber = "FieldNameYouWantSelectedValuetToBe";

there are some examples on www.devbuzz.com in the .NET forums as well as the
Compact Framework Quickstarts, and you'll defintiely want to look at
www.opennetcf.org for their CSV libraray or XML serializer (plus they have
TONS of other great stuff).

HTH,

Bill
 
Hi thanx fo the answer,
i don't need pocket access support because the acces file will be made on a
desktop pc, copied to the pda and then used to fill some treeviews and
listboxes...

from ur licensing story i guess that SQLCE is not some free software right
???
 
William Ryan eMVP said:
tiger79 said:
Hi,
I have read some info about the CF support for databases. Especially SQL
seems supported well... Only the whole idea is based on the idea of
connectionless which is naice but it also means that the ppc has to make
conrtact with an sql database server at some point... That is a problem for
me...

To have a data driven app, you'll need a datasource in some form or another.
That source can exists on a network, (A Sql Server for instance), the web
like a XML Web Service, an XML File located locally or on a network or a
database on the PDA like Sql Server CE or similar product.
I'd like to know if its possible to have a database file stored locally on
the ppc (preferably a .mdb, if no other option a sql) and to use parts of
the information stored in the file (using querys) to fill a treeview or a
listbox...

Yes, abosolutely. You can use SQL Server CE as one approach and you don't
have to use it in conjunction with the Desktop SQL SErver although that
certianly provides many benefits. In your case you think that's not doable.
Ok, but you can still use CE locally on your PDA. You can also use XML and
datasets, using DataSet.WriteXML on the desktop or wherever to serialize
your XML File, then transfer it, then use myDataSet =
SomeDataSet.ReadXML(@"\Storage Card\whatever.xml") or whatever file you
want. You can also use SQL CE like I mentioned or Pocket Access although if
you use POcket access you'll need a product like www.inthehand.com 's ADOCE
wrapper (which is a super good deal on it). Loading controls like a Treeview
involve iterating through your datasource and adding itmes/subitems while
you can use databinding with the listbox ... listbox.DataSource =
someDataSet.Table[0];
listbox.DisplayMember= "FieldNameYouWantShownInListBox";
listbox.ValueMemeber = "FieldNameYouWantSelectedValuetToBe";

thanx, but i won't use xml because its way too slow, i allready tried but
using dom to load a 300kb file is taking about 70 seconds which is too slow
to be used...
I am not using a pocket acces database file but a desktop version file...
 
btw, anyone have some sample on how to read from such an access file to a
treeview or listbox ???
I've found the tutorial and sample of OLE DB in the Visual Studio .Net but
that's not for the PPC :( The language is ok (C#) but the namespaces arent
existent in the CF...
SO is it so that CF only supports SQL ???
 
SQLCE is freely redistributable, but if you connect to SQL Server from SQL
CE, then you need a SQL Server CAL just as you would if any other kind of
user connected to SQL Server. It's not a SQL CE licensing issue - it's a SQL
Server issue.
 
Ginny,

I was not aware of this, it is very interesting.

We have a SQL processor license, rather than per-user or per-connection
license. I guess we are safe then to use SQL CE?

Thanks,
Saul
 
I am not using a pocket acces database file but a desktop version file...

when you copy an Access-File from the Desktop to the PocketPC via
ActiveSync it becomes a PocketAccess-File AFAIK

Boris
 
Back
Top