The problem is interesting (I know that), but I not found a solution Yet
Your propositions are interesting, but, are not "allowed"
I need to save the connection because the applications will be connected to a server by identification. This server is a stream server
It's like a TV-stream.
The first application connect to the server (with identification), the server gives the stream and the data is like movies
When a second application is launched on the same computer, I want only that the new process uses the connection created before and the objects (videos) downloaded before. And not make another connection (so another identification, another stream because there is a stream yet
It's why I need a solution to store in a boject my connection and my data
I think I need to use Com or Com+ and services. But I don't know yet how the first process can launch a server to be accessible. It work when I launch a server and after my process, but not when my process launch the server
Your solution
An alternate approach though would be to have a single utility application
service or even a web service that handles your data tier work. That singl
application could create the connections, hit the database and grab the dat
you want, before serializing it and passing it on to a requestin
application. Again this means limiting the scope of the connection objec
itself, but it does address what seems to be a fairly large need of yours
and that is to have a single persistent data access layer in your code
is what I try. But I have a little problem : this third application may be launched by another process and could not be launched before
Thx for your reponse
Sorry for my english (I'm french but my question is too hard for the french community, too few people uses C# in France
Sorry for the time I read you
Ashur
----- Pete Wright wrote: ----
Interesting problem. First up let's look at the connection part. Personall
I wouldn't pass a connection object around between applications. The reaso
is that in .NET it's good practice to limit the scope of a connection a
much as possible to conserve resources. This isn't as much as a problem a
you might think it is in your case. ADO.NET will automatically handl
connection pooling so long as both applications use precisely the sam
connection string. This means the hit in creating the connection object th
second, third, and so on, number of times is far less than it is the firs
time. So, instead of passing the connection object itself around, just pas
the connection string
In the applications themselves, use this string to build your connectio
object, hit the database to what you need then disconnect and close th
connection as soon as possible. In .NET the issue I imagine you are tryin
to solve by passing a connection object around really doesn't exist. Yo
just need to think a little different
On the data side, serialization really should work. You are, after all, jus
talking about data, and again it comes down a little to design and bes
practices. Try to keep all your classes as loosely coupled and cohesive a
possible. That is to say, code in a class should focus on doing one thing
and doing it well, and should be designed such that the class could easil
be re-used in any other application since it has no hard ties to othe
classes or objects. This sounds like designing for re-use, and it is, bu
you'll find a number of other benefits from working this way. Have a crac
at it. Look at your class and object structure and ask yourself - could thi
be designed differently to make the classes lighter, more efficient an
solve the other issues I have. You may be surprised by what you find
An alternate approach though would be to have a single utility application
service or even a web service that handles your data tier work. That singl
application could create the connections, hit the database and grab the dat
you want, before serializing it and passing it on to a requesting
application. Again this means limiting the scope of the connection object
itself, but it does address what seems to be a fairly large need of yours,
and that is to have a single persistent data access layer in your code.
Does that help ?
--