data connection of .net Framework & .net Compact Framework

G

Guest

Hi,
I'm planning to create a database apllication in C# using .NET Framework.
But I would also like to create a .NET Compact Framework application where it
shares this database. It will add to the database as well as getting updated
data from it.
So, I am trying to figure out, how to link this database to both
applications..

Can anybody help me on this problem Please?
All the help is appreciated :)
 
P

Paul G. Tobey [eMVP]

Store the data in SQL Server on the desktop and access the data from your
Windows CE box via Remote Data Access. The desktop should be able to
connect to the same database.

Paul T.
 
G

Guest

I was planning to do a retaurant management system so I am stuck on what
program to use actually ?
Is it feasible to use SQL Server Compact edition as a basis of database &
not use Express edition ??
Since the project will mosly rely on the database and that wireless system
will just be a part of it, I wasn't sure what to do...
Pleaseeeee Help someone....
 
G

Ginny Caughey [MVP]

SQL Compact is best for standalone apps, whether on the desktop or device.
If your desktop app will require multiuser access across a network, then
you'll want Express or SQL Server there. If the wireless connection is
really available thoughout the restaurant, then you could also access
Express or SQL Server from mobile devices, but connectivity is something
you'll want to test before going down this route. If connectivity is spotty
as is often the case, consider Express or SQL Server for big machines with a
local SQL Compact cache on the mobile devices as Paul suggested. Sync
Services for ADO.Net, currently in beta, is designed to assist with this
scenario, and RDA is also an option for syncing data between mobile devices
and a server.

If your question is more about how to connect to Express from C#, use the
SqlClient namespace on mobile devices just as you would on a desktop. The
only real difference is that if you're using Windows Authentication, you
need to provide the username and password from the mobile app, unlike on the
desktop.
 
G

Guest

Thanks Ginny.
I am quite new and trying to gather as much info as I can about .NET & .NET
Compact frameworks, and which SQL to use....

I am planning to have the system with the multiple users therefore I'll use
SQL Express Edition. But maybe it's a silly question: Can I install SQL
Compact and SQL express editions on the same PC, and create the database on
Express. Then create an wireless apllication using this sql compact to
connect to the main database ?
 
G

Ginny Caughey [MVP]

Yes, you can install Express and SQL Compact on the same PC. You can write a
PC app that reads from data from Express and creates the SQL Compact
database. You can also write a PC app that reads from a SQL Compact database
and updates the Express database. But if you have a *reliable* wireless
connection, it would be easier to just connect directly to the Express
database from the mobile device.
 
G

Guest

What do u mean by : "it would be easier to just connect directly to the
Express
database from the mobile device."
do U mean that I create the main database from SQL Server and not create any
SQL CE for the mobile application ? If that's the case I would appreciate if
u can clear me on that; how do I meant to add to the database frequently and
get the updates from it so that I don't add duplicate data ??

(Thank you soo much for the quick responses earlier :) )
 
G

Ginny Caughey [MVP]

Yes, assuming you have a reliable wireless connection, you could connect to
the SQL Express database directly from the mobile device.
 
G

Guest

ok, Thanks Ginny :)

Ginny Caughey said:
Yes, assuming you have a reliable wireless connection, you could connect to
the SQL Express database directly from the mobile device.
 
G

Guest

I have decided to use Visual Studio 2005 and use C# as the implememtation
language.
I am searching for the methods for connecting to SQL Server from a mobile
device without creating SQL Server CE and connecting both, as Ginny suggested.
But I am coming across with so much different thing and confused now.
I would appreciate if you can tell me how I can do it..
Has it got anything to do with RemoteSQLCE ?

Thanks,
 
G

Ginny Caughey [MVP]

Hezal,

No you don't need RemoteSqlCE to connect directly to a SQL Server. You just
use th SqlClient namespace as you would on the desktop.
 
G

Guest

Thanks a lot Ginny :)


Ginny Caughey said:
Hezal,

No you don't need RemoteSqlCE to connect directly to a SQL Server. You just
use th SqlClient namespace as you would on the desktop.
 
H

Hezal

Hi,
I've created an SQL Server database and I've created a smart device
application in visual studio 2005. I then added the SQL Server database as a
data source to this project. Then I used one table from the database to
display it on the mobile device's form. I also don't know if thats the right
way to directly access the SQL SERVER database from a mobile device using
SQLClient .
When I build it, there is no error.
But when I debug it through the emulator I get the following error:

this._connection = new System.Data.SqlClient.SqlConnection();
this._connection.ConnectionString = "Data
Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\MainRestaurantManagementdb.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True;";
}

Can anyone help me please?

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top