GSReddy

Hi

I have a need to work on pocket pc application.

Scenario: In general user will take database backup from database server to local system. User perform some changes to his local database based on his requirement. Again user connects to database server and click on update, local database should update to server database by informing each record status to the user. ex: record 1 updated / call closed do you want to update

Here local database is going to be Pocket pc database and server database is on SQLDatabase. Can any one suggest best way to implement this feature in Windows Pocket pc, c#. I would appreciate your reply.

Thanks,



Re: Smart Devices VB and C# Projects How to use database for pocket pc application

GSReddy

I have need to work in pocket pc application.

Scenario: I have requirement to have two Clent applications, one is pocket pc and another one is windows client. it seems pocket pc can have local database, but database extension is .sdf. If wanted make use of local database, I have to use SqlCeObject. If I implent DAL using SqlCeobject, DAL can't used by windows client. Can any one suggest me the best way to manage common DAL for both the applications.

more over I need to take a local copy from sqlserver to pocket pc client and update back to sqlserver, when ever required through pocket pc client application. Please suggest implementation way. I would appreciate your reply.

thanks,





Re: Smart Devices VB and C# Projects How to use database for pocket pc application

GSReddy

Hi

I have a need work in pocket pc application. should I use .sdf database for database programming I have data on sqlserver, I need to take local copy on to pocket pc device and user may work on local copy (disconnected n/w). User connects pockets pc to network and click on update, data should be update back to sqlserver database on pc. Can any one suggest the best part of implementation. How to deploy application along with the database on pocket pc device I would appreciate your reply.

Thanks,





Re: Smart Devices VB and C# Projects How to use database for pocket pc application

Ilya Tumanov

Yes, you can use SQL Mobile for local data storage. SQL Mobile supports RDA and merged replication which would allow you to synchronize data easily with SQL Server. All that is described in numerous articles on MSDN and on the Web.

Your other questions also have been answered dozens (if not hundreds) times. I'm sure you'll find them using your favorite web search engine in no time.

I¡¯m going to merge your questions together as they are essentially one question.






Re: Smart Devices VB and C# Projects How to use database for pocket pc application

GSReddy

Ilya Tumanov wrote:

Yes, you can use SQL Mobile for local data storage. SQL Mobile supports RDA and merged replication which would allow you to synchronize data easily with SQL Server. All that is described in numerous articles on MSDN and on the Web.

Your other questions also have been answered dozens (if not hundreds) times. I'm sure you'll find them using your favorite web search engine in no time.

I¡¯m going to merge your questions together as they are essentially one question.

It would be great, if you can send me a link to the articles. I would apprecite your time.

thanks,





Re: Smart Devices VB and C# Projects How to use database for pocket pc application

GSReddy

Ilya Tumanov wrote:

Yes, you can use SQL Mobile for local data storage. SQL Mobile supports RDA and merged replication which would allow you to synchronize data easily with SQL Server. All that is described in numerous articles on MSDN and on the Web.

Your other questions also have been answered dozens (if not hundreds) times. I'm sure you'll find them using your favorite web search engine in no time.

I¡¯m going to merge your questions together as they are essentially one question.

Correct. RDA is used to synchronize, but it needs iis interaction with sufficient previllages. is this only the way to synchronize





Re: Smart Devices VB and C# Projects How to use database for pocket pc application

GSReddy

Thank for reply, RDA is works fine, but RDA and SQLCeReplication needs IIS interaction with Sufficient previllages. Any other ways to synchronize Mobile database data back to SQL server database by comparing and notifing changes to the user. Please suggest, I would appreciate your time.

Thanks,





Re: Smart Devices VB and C# Projects How to use database for pocket pc application

Ilya Tumanov

Sure, you can do it manually row by row ¨C there¡¯s SQL Client on devices, just like on a desktop. Connect to SQL Server and to SQL Mobile at the same time and go through rows as needed.

However, you will need stuffiest privileges to access SQL Server anyway so it makes no difference (not to count you would have to do, say, 100x times more work compared to RDA).

You might not realize it yet, but ISS in this case is a blessing:

- Isolates you from the SQL.

- Allows running encryption easily.

- Allows for wide range of access control mechanisms.

- Works anywhere in the world through proxies and firewalls if you want it to.






Re: Smart Devices VB and C# Projects How to use database for pocket pc application

GSReddy

Thank you for reply. I have written sequiential algorithm to compare both the datatables (queried data from two diff. sources to datatables). its working fine, but its taking 9 min to compare and synchronize 20K records, if changes are random. if changes are sequential, taking 4 min to synchronize same 20,000 records. it bacame useless to me due to time consumption.As you suggested before RDA might be good one to go. Please may I know what is ISS mentioned in your recent reply (any ref link plz). Please suggest.

I was drag into another probelm like, I have local database attached to my solution explorer, lets say sample.sdf. when ever I do DML operations, (insert, update) execute non-query is gets succeded, but changes does reflect on to database (verified sample.sdf database using server explorer). once I restart application, I couldn't see inserted records. For testing I have written basic insert statement depicts below. Please suggest me what could be the probelm. I would appreciate your reply and time. Thank you,

using (System.Data.SqlServerCe.SqlCeConnection con = new System.Data.SqlServerCe.SqlCeConnection("Data Source =\".\\Samples.sdf\"")){

using (System.Data.SqlServerCe.SqlCeCommand cmd = new System.Data.SqlServerCe.SqlCeCommand("insert into sample(name,loc,CallStatus)values('xx','Peoria','open')"))

{

cmd.Connection = con;

con.Open();

int rval = cmd.ExecuteNonQuery();

con.Close();

}

}





Re: Smart Devices VB and C# Projects How to use database for pocket pc application

Ilya Tumanov

Actually, 9 minutes for 20K records is very fast ¨C you¡¯ve done a good job here. Normally synchronization is done, say, once a day (e.g. after device owner gets back from the field and cradled device to be recharged overnight) so 9 minutes is pretty much nothing. If you have constant connection - simply talk to your SQL database. If you want it faster - track changes, e.g. by time stamp and synchronize only records changed since the last sync.

ISS mentioned is a typo, should be IIS.

Most common reason for changes not been preserved is what VS redeploys original database overwriting them each time you run the application from VS. Database only changes on the device, it never copied back to desktop.






Re: Smart Devices VB and C# Projects How to use database for pocket pc application

Rik78

I managed to transfer 422 000 records to the pocket pc (40 Meg) in 3 min and 54 secs.

Can this be done faster so please let me know :)






Re: Smart Devices VB and C# Projects How to use database for pocket pc application

Ilya Tumanov

If by "transfer" you mean "copy database file to device", it should be possible to do it in about 3-4 seconds if your device supports USB 2 High Speed (or you're using storage card and commodity card reader). Should be under a minute for 40 Mb database on USB 1.1 (which is the case with most devices).

Database synchronization is significantly more involved and takes time. Though it¡¯s possible to copy database file from device to desktop and use desktop CPU power for synchronization.






Re: Smart Devices VB and C# Projects How to use database for pocket pc application

Rik78

Hi

Yes, I mean to copy the database file to device. By using ActiveSync (both RAPI and from "explore"), time taken to copy is approx. 4 minutes.

I don't have USB 2 but 1.1. Maybe the speed is just device dependent

It's a handheld scanner with Windows CE 5. If i could get that speed under the minute, I would be very happy.

I think it's much better to utilize the power of the desktop to do the synchronizing, and just copy database files needed to and from the device programmatically. I don't want our customers to copy the databases manually using memory cards, even though it's much faster.






Re: Smart Devices VB and C# Projects How to use database for pocket pc application

GSReddy

1) Thank you for reply. In my case device sync back to server once a day or some times twice. I wanted to know, how do I query the changed/Edited records using timestamp from both the sources(local DB/server DB) to DataTables. Please suggest little more.

2) if I insert or update records through query analyzer to local database (sample.sdf), those records were stored in database permanently. when ever I run application, DB records are displaying on grid (inserted through query analyzer). If I insert record through application using basic insert/update statements, inserted/updated records are loads to grid still I close the application. Once I restart application, I couldn't the inserted/updated records from application. This one I am testing in emulator, app running on my laptop, still I haven't deploy to device. Please suggest me, or possible send ref link. I would appreciate your reply. thank you

previous post: I have local database attached to my solution explorer(Add item -> add Mobile database -> this stores in application directory), lets say sample.sdf. when ever I do DML operations, (insert, update) execute non-query is gets succeded, but changes does updated to database (verified sample.sdf database using server explorer). once I restart application, I couldn't see inserted or updated records in local database (.sdf). I have written basic insert statement depicts below. Please suggest me what could be the probelm. I would appreciate your reply and time. Thank you,

using (System.Data.SqlServerCe.SqlCeConnection con = new System.Data.SqlServerCe.SqlCeConnection("Data Source =\".\\Samples.sdf\"")){

using (System.Data.SqlServerCe.SqlCeCommand cmd = new System.Data.SqlServerCe.SqlCeCommand("insert into sample(name,loc,CallStatus)values('xx','Peoria','open')"))

{

cmd.Connection = con;

con.Open();

int rval = cmd.ExecuteNonQuery();

con.Close();

}

}





Re: Smart Devices VB and C# Projects How to use database for pocket pc application

GSReddy

How do we tune in application programming to use desktop CPU power for synchronization. is it nothing but, if we write sync application, which runs on desktop pc, that makes use of pc power. Please suggest.