Click here to Skip to main content
12,889,448 members (51,613 online)
Rate this:
Please Sign up or sign in to vote.
but whn I passed this query through moible application it excute but data not save .. whyy

string path;
path = System.IO.Path.GetDirectoryName(
SqlCeConnection con = new SqlCeConnection(@"Data Source=" + path + @"\AppDatabase2.sdf;Persist Security Info=False");
 string Query = "Insert into userlist(usernames,pwd) values('ff','ff')";
 SqlCeCommand cmd = new SqlCeCommand(Query);
cmd.Connection = con; 

[edit]Code block tidied up, Tags - OriginalGriff[/edit]
Posted 24-Jun-11 1:17am
Updated 24-Jun-11 1:23am
OriginalGriff 24-Jun-11 7:22am
Don't ask this as an add-on to a previous question, and also ask it as a full question in it's own right: you duplicate work and annoy people!

As I asked on the add-on bit: any error message? Any Exception?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Make sure you have rights to access the appropriate DB and that the path is correct.
Based on[^], this connection string looks appropriate.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170424.1 | Last Updated 24 Jun 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100