SQL CE & output parameters?

  • Thread starter Thread starter dw
  • Start date Start date
D

dw

I want to run a query that will return a single value and
I have tried to add parameters as Output or ReturnValue
to my SqlCe Command object and they don't work...in fact,
I get an error...something about how the parameter
direction won't work. Does Sql CE not support output
parameters???

thanks.
- dw
 
Output and Returnvalue parameters are defined fro stored procedures which
are not supported on SqlCE. Instead you may want to use
SqlCeCommand.ExecuteScalar method:
SqlCeCommand cmd = new SqlCeCommand();
cmd.CommandText = "select FirstName + ' ' + LastName Name from Authors where
AuthorID = 123";
string name = (string) cmd.ExecuteScalar();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top