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();
 
Back
Top