Hello!
I'm developing a Windows Mobile WinForm application that uses Sql Server CE 3.1 with .NET Compact Framework 2.0 SP2 and C#.
I have a form that has a SqlCeConnection object, opened during all of it's execution time: I open the connection at startup and close it on event closing.
I also have a class to read the Sql Server CE database.
My question is about performance: Which of these two situations is the best?
1. When I create a object of reader class, pass to contructor the SqlCeConnection object and hold it into this new object as a property.
2. Always, when I call a method of this reader class, pass the SqlCeConnection object as a parameter.
I think if I use situations 1, I have two SqlCeConnection objects, isn't it?
If you need more details, tell me.
Thank you!