Click here to Skip to main content
15,894,825 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
It is possible to use stored procedure on a pocket pc. I did not find any information about that. If yes where can I found documentation on that.

This is my code in c#:

SqlCeConnection SqlCnx = new SqlCeConnection(GlobalVar.strConnexion);
                try
                {
                    SqlCeCommand myCommand = new SqlCeCommand("getAuction", SqlCnx);
                    myCommand.CommandType = CommandType.StoredProcedure;
                    SqlCeDataAdapter dataAdapterInfoAuctList = new SqlCeDataAdapter(myCommand);
                    dataAdapterInfoAuctList.Fill(dataSetInfosalvage, "auct");
                    dataTableAuct = dataSetInfosalvage.Tables["auct"];
                    dtgridAuction.DataSource = dataTableAuct;
                }
                catch (SqlCeException Ex)
                {
                    MessageBox.Show("Error 0002 :\n" + Ex.Message, "SQL Error", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1);
                }
                finally
                {
                    SqlCnx.Dispose();
                }

But that give me an error :

The CommandType enumeration value, 1, is invalid.

I need help.
Posted
Updated 24-Jun-11 0:35am
v2
Comments
[no name] 24-Jun-11 6:36am    
Edited for Code Block.

1 solution

No. SqlCE does not support stored procedures.

Think about it: it is a single user database, it doesn't need stored procedures (gospel according to Microsoft).
 
Share this answer
 
Comments
imtiazahmad 24-Jun-11 7:15am    
thanks for the reply.
but whn I passed this query through moible application it excute but data not save .. whyy
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();
OriginalGriff 24-Jun-11 7:20am    
Did you get an error message? Any exception?

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900