Click here to Skip to main content
15,905,875 members
Home / Discussions / C#
   

C#

 
GeneralRe: how difficult does getting an instance by handle have to be? Pin
spazzman12-Jul-04 5:50
spazzman12-Jul-04 5:50 
GeneralRe: how difficult does getting an instance by handle have to be? Pin
MilesAhead12-Jul-04 6:55
MilesAhead12-Jul-04 6:55 
GeneralTreeView with ComboBoxes in TreeNodes Pin
theoutlander7-Jul-04 11:19
theoutlander7-Jul-04 11:19 
GeneralRe: TreeView with ComboBoxes in TreeNodes Pin
Heath Stewart7-Jul-04 12:38
protectorHeath Stewart7-Jul-04 12:38 
GeneralHowTo change color on statusbar Pin
QzRz7-Jul-04 9:54
QzRz7-Jul-04 9:54 
GeneralRe: HowTo change color on statusbar Pin
Heath Stewart7-Jul-04 12:50
protectorHeath Stewart7-Jul-04 12:50 
Generalproblem with SQLServer CE Pin
JulienR7-Jul-04 8:51
JulienR7-Jul-04 8:51 
GeneralRe: problem with SQLServer CE Pin
Heath Stewart7-Jul-04 12:56
protectorHeath Stewart7-Jul-04 12:56 
FYI, a DataAdapter derivative like SqlCeDataAdapter will open the close the connection itself. Logically, there's no way to query for data unless it connects to the database. You should not open the connection yourself.

If you read the documentation for the SqlCeConnection class in the .NET Framework SDK, you might notice the following:
Although SQL Server CE only supports one connection at a time, multiple commands can share the same connection. This means that it is possible to have multiple instances of SqlCeDataReader open on the same connection. This behavior differs from that of System.Data.SqlClient.
Since you're using two assemblies, you do have the option of exposing the connection. Since both the MC++ and C# assemblies are .NET assemblies (both compiled to IL, although a mixed mode MC++ assembly may also contain native instructions), you can reference one from another. So perhaps you could expose the SqlCeConnection from the MC++ assembly and the C# assembly could use that. You could - through mutexes or some other locking mechanism - make sure that the SqlCeConnection in one assembly is closed and disposed (always call Dispose on IDisposable implementations when you're finished with them) before attempting to make another connection (perhaps using a broker or provider pattern).

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: problem with SQLServer CE Pin
Anonymous8-Jul-04 2:30
Anonymous8-Jul-04 2:30 
GeneralRe: problem with SQLServer CE Pin
Heath Stewart8-Jul-04 3:12
protectorHeath Stewart8-Jul-04 3:12 
GeneralCustom Listbox controls Pin
kam33mitch7-Jul-04 8:08
kam33mitch7-Jul-04 8:08 
GeneralRe: Custom Listbox controls Pin
Heath Stewart7-Jul-04 13:04
protectorHeath Stewart7-Jul-04 13:04 
GeneralRe: Custom Listbox controls Pin
kam33mitch7-Jul-04 14:40
kam33mitch7-Jul-04 14:40 
Questionbitmap to byte array ? Pin
kendao7-Jul-04 7:10
kendao7-Jul-04 7:10 
AnswerRe: bitmap to byte array ? Pin
Grimolfr7-Jul-04 8:05
Grimolfr7-Jul-04 8:05 
AnswerRe: bitmap to byte array ? Pin
Heath Stewart7-Jul-04 8:50
protectorHeath Stewart7-Jul-04 8:50 
GeneralProgress Bar in Status bar panel Pin
bouli7-Jul-04 4:38
bouli7-Jul-04 4:38 
GeneralRe: Progress Bar in Status bar panel Pin
Heath Stewart7-Jul-04 5:55
protectorHeath Stewart7-Jul-04 5:55 
GeneralRe: Progress Bar in Status bar panel Pin
bouli7-Jul-04 23:52
bouli7-Jul-04 23:52 
GeneralRe: Progress Bar in Status bar panel Pin
Heath Stewart8-Jul-04 3:16
protectorHeath Stewart8-Jul-04 3:16 
GeneralRe: Progress Bar in Status bar panel Pin
bouli8-Jul-04 22:08
bouli8-Jul-04 22:08 
GeneralRe: Progress Bar in Status bar panel Pin
Gary Thom7-Jul-04 5:58
Gary Thom7-Jul-04 5:58 
GeneralRe: Progress Bar in Status bar panel Pin
bouli7-Jul-04 23:53
bouli7-Jul-04 23:53 
GeneralRe: Progress Bar in Status bar panel Pin
Gary Thom8-Jul-04 0:10
Gary Thom8-Jul-04 0:10 
Questionhow does this exception happened Pin
noosword7-Jul-04 2:58
noosword7-Jul-04 2:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.