|
Hello!
I am facing some problems on the development of my mobile simlpe application connecting to an SQLCE database.
After searching a bunch of sites, tutorials and Q&A's my code seems to be correct and I can't figure out what's going wrong.
This is my code:
SqlCeConnection conn = new SqlCeConnection("Data Source=ChokweDB.sdf");
SqlCeCommand insertForm1 = new SqlCeCommand("INSERT INTO Form1Table (p1,p2,p3,p4,entrevistador,data) values ('" + p1.Text + "','" + p2.Text + "','" + p3Value + "','" + p4Value + "','" + txtEntrevistador.Text + "','" + txtData.Text + "')", conn);
conn.Open();
insertForm1.ExecuteNonQuery();
conn.Close();
My database is placed in the home directory of the application (filename ChokweDB.sdf). When I run the code, MVS2008 will simply not find the database:
The database file cannot be found. Check the path to the database. [ Data Source = ChokweDB.sdf ]
Why oh why? What am I missing?
|
|
|
|
|
Hi Vafo,
in your code you have to specify exact database path.
<br />
string DBPath = @"Program Files\ChokweDB.sdf";<br />
SqlCeConnection conn = new SqlCeConnection("Data Source=" + DBPath );
hope this will help you...
Pavan Pareta
modified on Friday, April 24, 2009 2:47 PM
|
|
|
|
|
Can't build, unrecogized escape sequence error after each dash...seen this before..
string dbconn = "@C:\Documents and Settings\Vasco\Ambiente de trabalho\Serviços de Informática\ChokweMobile\ChokweDB.sdf";
SqlCeConnection conn = new SqlCeConnection("Data Source=" + dbconn);
And after some correcting...
<pre> string dbconn = @"C:\Documents and Settings\Vasco\Ambiente de trabalho\Serviços de Informática\ChokweMobile\ChokweDB.sdf";
SqlCeConnection conn = new SqlCeConnection("Data Source=" + dbconn);
Returns Path not valid.
And...
string dbconn = @".\ChokweDB.sdf";
The database file cannot be found. Check the path to the database. [ Data Source = .\ChokweDB.sdf ]
The database IS o the same folder as the application - and it really IS there and the name is spelled correctly..
modified on Thursday, April 23, 2009 7:10 AM
|
|
|
|
|
Hi,
Add data source in your project.
then select your database (.sdf) file in your solution. then click properties then
set the value of Copy to Output Directory = Copy Always.
Try this.
Thanks
~Khatri Mitesh
khatrimitesh@hotmail.com
Bikaner (Rajasthan)
INDIA
http://www.youtube.com/watch?v=-oJaaPCrk3Q
|
|
|
|
|
you should to add the data base trough add elements there you can see your data base and can execute program to compile if you want to compile trough mobile device add the data base in mobile device
Thanks
|
|
|
|
|
Try this
string path = "Data Source =";
path += System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
path += "\\Database.sdf";
then
myConnection = new SqlCeConnection(@path);
cheers
|
|
|
|
|
I have a very basic question but have lost some time wondering and digging the webs for an answer already - should be extra easy to answer tho:
I am developing a windows form for Windows Mobile 6 in C#, using Visual Studio 2008. I have two sets of radiobuttons in a form, and I want to separate them. I have learned I should use the WS_GROUP option, but the dumb question is...
"Where/how do I set this WS_GROUP option?"
Appreciate some reply - thank you for your attention
|
|
|
|
|
Can you confirm the development language that you are using? WS_GROUP is a windows style constant that is used in programs written in C/C++. For C# you would accomplish grouping radio buttons by either placing them in the same container (groupbox or panel).
|
|
|
|
|
Placing them inside a panel was the answer. Thanks.
|
|
|
|
|
I make code for read in web based mySql.
my php code able to read mySql and push to string.
$yoResult = iconv("EUC-KR", "UTF-8", $outxml);
echo $yoResult;
$yoResult is...
<?xml version="1.0" encoding="utf-8" ?>
<yodata>
<yovalue1>bla bla </yovalue1>
</yodata>
my window mobile code read that data string.
But i don't know How to handle that data!
How do I approach that data?
|
|
|
|
|
You might want to check out the XmlTextReader class or the ReadXml method of the DataSet object (Depending on what you are doing).
|
|
|
|
|
I give you here complete example for xml in windows mobile : It would show you in listbox all title and link of xml >
using System.Net;
using System.IO;
using System.Xml;
XmlTextReader reader = new XmlTextReader(filename );
while (reader.Read()) // if stream readed
{
XmlNodeType nodetype = reader.NodeType; // checking nodes every type
if (nodetype == XmlNodeType.Element)
{
if (reader.Name == "title")
{
listBox1.Items.Add("........................");
listBox1.Items.Add(reader.ReadString());
}
if (reader.Name == "link")
{
listBox1.Items.Add(reader.ReadString());
}
}
}
reder.Close();
xml :
<root>
<title> Newgame
http:...........<title> Newpc
http:...........
|
|
|
|
|
Hi,
I'm using C# and .net Compact Framework 2.0.
I want to draw a polygon at various angles, in other words I want to rotate it. However, I don't know the maths to do this,
transformation matix aren't part of the Cf so I've to figure it out for myself, any pointers?
Thanks
Gem
|
|
|
|
|
Why not just make your own transformation matrix class?
|
|
|
|
|
yup, thats what I'm trying to figure out
|
|
|
|
|
Hi
I think there is an article on this site which deals with this...
Also check SourceForge which i also think has some code to cover this (svg for cf).
Good luck
|
|
|
|
|
|
Hi everyone!
I have had so much help from this wonderfull site! Its time to give something back
I have made a really nice RAD framework for making finger-friendly apps for WM. Its called GSlide and is a teeny-tiny-bit revolutionary in its architecture i must say. Most importantly really easy to work with!
Check it out and please give me feedback!
www.gslide.mobi
Ciao,
Lars
|
|
|
|
|
Hi,
I download GSlide Framework. but how i install this framework. and how i use this. i not get any document in your site about "How to you?".
Can u provide a document for how i use this. if possible also provide any sample project for this.
Thanks
~Khatri Mitesh
khatrimitesh@hotmail.com
Bikaner (Rajasthan)
INDIA
http://www.youtube.com/watch?v=-oJaaPCrk3Q
|
|
|
|
|
Hi, thanks for your question
GSlide operates slightly different than other frameworks since it uses more of a new component architecture with exe files responding to outside procedure-calls.
The nice thing about this is that prototyping can be VERY rapid, even be accomplished on your actual device.
GSlide is in other words not "installed" or used as a GUI component in the normal VS manner.
Think of GSlide developing more like client/server, or browser/server, developing.
Play around with the script-files on your device, or in the desktop emulator to get started. There are also examples in the menu on the site.
Im working on fun tutorials!
Ciao,
Lars
|
|
|
|
|
I use VS2005 create a smart device project, select WM5-PPC SDK and application type = windows application.
In "WndProc", I print every message with the flowing code,
if(message != WM_TIMER)
{
TCHAR str[256] = {0};
_stprintf(str,_T("message = %d \r\n"),message);
OutputDebugString(str);
}
But when I press the left softkey or the right, I didn't receive a WM_KEYDOWN message,
Does anybody knows something about this or any solution?
Thanks in advance.
|
|
|
|
|
Hello.
For my current Windows Mobile application I need to hook all hardware keys like the Green button (answer call) or the Red button (end call). How can I do this preventing the user to skip my app.
Another problem I have is to keep my app always on top. I'm using the P/Invokes:
ShowWindow(this.Handle, SetWindowState.SW_SHOW);
SetForegroundWindow(this.Handle);
SetActiveWindow(this.Handle);
but without a real success.
The third thing is how can I suppress the incomning call notification on a windows mobile phone? Or better how can I suppress/disable all popup notifications like "Cannot connect"-bubble, "Low battery" warning or incoming call notification?
I hope someone can give me an answer to this questions. Thanks in advance.
Best regards, merlot
|
|
|
|
|
Hi! I need to capture the hardware keys too.. Have u found the way to do it??
Thank you in advace,
kelly
|
|
|
|
|
I am developing smartdevice application uisng .net 2005 + WindowsCE 5.0
(not for pocketpc and not for smartphone)
I want to change picture box image when i click on command button for this i have place two button and picture box on my form and i have put my tow images in my image folder. Please update me for How to pass image to picture box at run time from specific folder.
|
|
|
|
|
Hi,
Try this code..
Me.PictureBox1.Image = New Bitmap("\1.PNG")
May it solves your problem.
Thanks
~Khatri Mitesh
khatrimitesh@hotmail.com
Bikaner (Rajasthan)
INDIA
http://www.youtube.com/watch?v=-oJaaPCrk3Q
|
|
|
|