I wanna to know exactly how we do these thing on C# .NET 4.0 Form Application:
- Declaring SqlCeParameterCollection Object
- Adding Parameters to the collection
- Add the Collection to the Command
Here are samples of my current code:
-
Declaring & Adding
SqlCeParameterCollection Parameters = new SqlCeCommand().Parameters; Parameters.Add("username", Username); Parameters.Add("password", Password);
Now how to add this collection at once to the command?
Thanks
Try this:
If you must set up your parameters separately, up front, then you need to do something like this (since you cannot directly use
SqlCeParameterCollection):