473,323 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Working with database in C# Pocket PC

Working with database in C# Pocket PC

Hi all,
I want to develop an application that work with DB on pocket PC.
I have added the DB to the project from Menu->Data->Add New Data
Source.
I want to insert some Rows in a table of this Db.
I know that I can create a connection and insert values with sql
statements like that:

public void SaveSettings(TSaveSettings Values)
{

DBConnection = new SqlCeConnection();
DBConnection.ConnectionString = @"Data Source = ..\My
Documents\Db.sdf";

//Create a SqlCeCommand on your connection
SqlCeCommand InsertCommand = DBConnection.CreateCommand();

//Set the CommandText for the command
//The ?'s represent parameters that will be set later
InsertCommand.CommandText = "Insert Into Settings(ComPort)
Values (?)";

//Add parameters and assign them the values from the
TextBoxes on the form
InsertCommand.Parameters.Add(new SqlCeParameter("ComPort",
SqlDbType.NText));

InsertCommand.Parameters["ComPort"].Value =
Values.ComPort;

//Open the connection, execute the query
DBConnection.Open();
InsertCommand.ExecuteNonQuery();

//Close the connection
if (DBConnection.State == ConnectionState.Open)
DBConnection.Close();
}

in this way it work, but why I have added the Db to the project? I
want from my application to make operation on my DB without creating
connection, open it and close it by code, but I want to use smoe
things like dataset, adding rows by rows.add().. and so on.

Can you help me with some examples or tutorials on line?
thank you very much

Apr 6 '07 #1
2 4834
On Apr 6, 3:00 pm, "Sheikko" <shei...@gmail.comwrote:
Working with database in C# Pocket PC
in this way it work, but why I have added the Db to the project? I
What do you meant? Can you make it clear?

Apr 6 '07 #2
I'm not sure exactly what you're asking, but tutorials are available here:
http://www.microsoft.com/sql/edition...t/default.mspx

--
Ginny
"Sheikko" <sh*****@gmail.comwrote in message
news:11**********************@l77g2000hsb.googlegr oups.com...
Working with database in C# Pocket PC

Hi all,
I want to develop an application that work with DB on pocket PC.
I have added the DB to the project from Menu->Data->Add New Data
Source.
I want to insert some Rows in a table of this Db.
I know that I can create a connection and insert values with sql
statements like that:

public void SaveSettings(TSaveSettings Values)
{

DBConnection = new SqlCeConnection();
DBConnection.ConnectionString = @"Data Source = ..\My
Documents\Db.sdf";

//Create a SqlCeCommand on your connection
SqlCeCommand InsertCommand = DBConnection.CreateCommand();

//Set the CommandText for the command
//The ?'s represent parameters that will be set later
InsertCommand.CommandText = "Insert Into Settings(ComPort)
Values (?)";

//Add parameters and assign them the values from the
TextBoxes on the form
InsertCommand.Parameters.Add(new SqlCeParameter("ComPort",
SqlDbType.NText));

InsertCommand.Parameters["ComPort"].Value =
Values.ComPort;

//Open the connection, execute the query
DBConnection.Open();
InsertCommand.ExecuteNonQuery();

//Close the connection
if (DBConnection.State == ConnectionState.Open)
DBConnection.Close();
}

in this way it work, but why I have added the Db to the project? I
want from my application to make operation on my DB without creating
connection, open it and close it by code, but I want to use smoe
things like dataset, adding rows by rows.add().. and so on.

Can you help me with some examples or tutorials on line?
thank you very much
Apr 8 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: mosquitooth | last post by:
H I'm new to pocket pc programming, but what I want to do is the following I want to create an application that runs on the pocket pc and accepts user input (via menus, buttons, etc). Now, all...
2
by: Poewood | last post by:
I'm trying to connect to an access database that has been converted to a .cdb database on my Pocket PC. I'm having a problem getting the connection string right. Does anybody have a clue as to...
8
by: Krishnan Margabandhu | last post by:
I'm writing a Pocket PC app that will run when a device is first powered on. I want this program to get some data from the user and invoke a CAB file to install a software on the device. How do I...
1
by: A_PK | last post by:
Hi, Thank for Harry and Ken for guiding me the installation process of Pocket PC. Now, seem to be able to install with one cab file under my ini file. Anyway I have another problem here. I...
0
by: polocar | last post by:
Hi all, I'm writing in Visual C# (of Visual Studio .NET 2003 Professional Edition package) a program that must run in a pocket PC (with Pocket PC 2002 installed), so when I created the project I...
2
by: Sheikko | last post by:
ADO.NET - Working with DataSet ========================= HI, I want to create an application that interact with a DB. I wont to use SQL statement, but I want to use DataSet. - I have created my...
2
by: rastrol7 | last post by:
I've been developing a stylesheet that takes XML from a database and parses it into a web page. The output for one field of the database consists of html code that I want passed on to the page I'm...
0
by: =?Utf-8?B?SnVzdGluIFJvYmVydHM=?= | last post by:
Hi I am developing a mobile web VB asp.net application in VS 2005. The forms are mobile web forms. I have a mobile web configuration page (web.config). In one of my forms I have a DeviceSpecific...
5
by: Terry Metcalfe | last post by:
I have an Asus A696 pocket PC. I have written a small test program in VB6 called "Pocket PC" and compiled it just as I would normally do to run on my desk top. It runs on my desk top perfectly...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.