Re: Passing Data Between Assemblies
- From: "Ollie Riches" <ollie.riches@xxxxxxxxxxxxxxxxx>
- Date: Fri, 15 Apr 2005 16:51:57 +0100
If the assemblies are in the same process (appdomain) then you can could
have a private static variable on a class and this can then be assigned at
runtime and shared between the assemblies via a class property.
If you need more information on static keyword in .Net check out:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vclrfStaticPG.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vclrfCSharpKeywords_PG.asp
--
HTH
Ollie Riches
http://www.phoneanalyser.net
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a programmer
helping programmers.
"Mythran" <kip_potter@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:ufLfysQQFHA.3384@xxxxxxxxxxxxxxxxxxxxxxx
> I have 2 assemblies (for example). Assembly A references assembly B. If
I
> have a value in assembly A that I want to be used in assembly B, how can I
> store it so that assembly B can access it without actually "passing" the
> value to assembly B?
>
> I've seen the Threading.Thread.CurrentThread.SetNamedDataSlot method and
was
> wondering if that could be "safely" used to store information that would
be
> passed normally to just about every public method in my class (such as a
> connection string).
>
> Reason why I am not storing the Connection String inside the App.config is
> it is automatically generated based on user-input. So, I would hate to
have
> to pass this information into the business logic layer and then into the
> data access layer every time I want to access the database. I do not want
> to store this information on disk or registry because it may contain
> passwords which we do not want stored anywhere else but memory...
>
> Look, I'm babbling! Anywho, thanks for the help y'all :)
>
> Mythran
>
.
- References:
- Passing Data Between Assemblies
- From: Mythran
- Passing Data Between Assemblies
- Prev by Date: Re: IEnumVariant in C#
- Next by Date: Re: why it report this errot?
- Previous by thread: Passing Data Between Assemblies
- Next by thread: DataGrid: how to make DataGrid sort manually?
- Index(es):
Relevant Pages
|