473,806 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(TS aveSettings Values)
{

DBConnection = new SqlCeConnection ();
DBConnection.Co nnectionString = @"Data Source = ..\My
Documents\Db.sd f";

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

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

//Add parameters and assign them the values from the
TextBoxes on the form
InsertCommand.P arameters.Add(n ew SqlCeParameter( "ComPort",
SqlDbType.NText ));

InsertCommand.P arameters["ComPort"].Value =
Values.ComPort;

//Open the connection, execute the query
DBConnection.Op en();
InsertCommand.E xecuteNonQuery( );

//Close the connection
if (DBConnection.S tate == ConnectionState .Open)
DBConnection.Cl ose();
}

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 4853
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.goo glegroups.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(TS aveSettings Values)
{

DBConnection = new SqlCeConnection ();
DBConnection.Co nnectionString = @"Data Source = ..\My
Documents\Db.sd f";

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

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

//Add parameters and assign them the values from the
TextBoxes on the form
InsertCommand.P arameters.Add(n ew SqlCeParameter( "ComPort",
SqlDbType.NText ));

InsertCommand.P arameters["ComPort"].Value =
Values.ComPort;

//Open the connection, execute the query
DBConnection.Op en();
InsertCommand.E xecuteNonQuery( );

//Close the connection
if (DBConnection.S tate == ConnectionState .Open)
DBConnection.Cl ose();
}

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
352
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 the information by the user shall be stored and (when a hot sync is made) shall be written into an access database (e.g. in a specific table) How could I do this Thanks a lo mosquitooth
2
1369
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 where you put an object on a PocketPC and then connect to it. Does it have to be in a specific place or can it be anywhere on the device? This is the string I have now. I can get more specific like \Storage Card\PSR.cdb connString =...
8
4825
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 invoke a CAB file from the VB app? Thanks
1
1160
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 tried to add a new Folder named DatabaseFolder with database.sdf under my Setup Project / Application Folder. However, when I install my application,
0
1293
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 selected "Visual C#" as "Project Type" and "Smart Device Application" as "Model". This program must connect to an Access database (stored in the Pocket PC too) and read, edit and update its tables' values. To my unspeakable horror, I noticed...
2
1520
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 application - From SERVER EXPLORER panel, I have added a connection to a database (MyDB) and the name of the dataset is "MyDBDataSet" . - From DATA SOURCE panel, I have added Tables that I want to use (Setting).
2
1281
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 designing. A sample of the value is: <brief_description>Short Sleeve Golf Shirt&lt;br&gt;100% Combed Cotton&lt;br&gt;No Pocket&lt;br&gt;Assorted Colors&lt;br&gt;Imported</brief_description> Currently I've been able to get just this to show up: Short Sleeve Golf...
0
1309
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 control so that I can choose to use an asp:TextBox when PocketIE is detected, otherwise I want to use a mobile:TextView control. Here is a snippet of my asp code:
5
2973
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 normally. I then copied the application file to my Pocket PC. When I try to run it on my Pocket PC I get the error message " 'Pocket PC' is not a valid Pocket PC application ". I am right in assuming that I cannot use VB6 to write programs...
0
9718
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10364
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10109
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5545
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4328
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.