Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: SQL-CE C# Mobile
but whn I passed this query through moible application it excute but data not save .. whyy
 

 
string path;
path = System.IO.Path.GetDirectoryName(
System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
SqlCeConnection con = new SqlCeConnection(@"Data Source=" + path + @"\AppDatabase2.sdf;Persist Security Info=False");
 string Query = "Insert into userlist(usernames,pwd) values('ff','ff')";
 con.Open();
 SqlCeCommand cmd = new SqlCeCommand(Query);
cmd.Connection = con; 
 
cmd.ExecuteNonQuery();
 
[edit]Code block tidied up, Tags - OriginalGriff[/edit]
Posted 24-Jun-11 2:17am
Edited 24-Jun-11 2:23am
v2
Comments
OriginalGriff at 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
good
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 http://www.connectionstrings.com/sql-server-2005-ce[^], this connection string looks appropriate.
  Permalink  

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

  Print Answers RSS
0 Zoltán Zörgő 200
1 Sergey Alexandrovich Kryukov 160
2 Peter Leow 90
3 Ramza360 51
4 Arkadeep De 50
0 Zoltán Zörgő 80
1 the other paul 23
2 Shmuel Zang 10
3 Aarti Meswania 5
4 Member 11389991 -2


Advertise | Privacy | Mobile
Web01 | 2.8.150129.1 | Last Updated 24 Jun 2011
Copyright © CodeProject, 1999-2015
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