Click here to Skip to main content
Sign Up to vote bad
good
See more: SQL-CEC#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 - 1:17
Edited 24 Jun '11 - 1:23

Comments
OriginalGriff - 24 Jun '11 - 7:22
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

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
Your Filters
Interested
Ignored
     
0 Mahesh Bailwal 353
1 Sergey Alexandrovich Kryukov 339
2 Maciej Los 290
3 CPallini 245
4 Rohan Leuva 175
0 Sergey Alexandrovich Kryukov 9,287
1 OriginalGriff 7,204
2 CPallini 3,923
3 Rohan Leuva 3,211
4 Maciej Los 2,713


Advertise | Privacy | Mobile
Web04 | 2.6.130516.1 | Last Updated 24 Jun 2011
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid