Groups | Blog | Home
all groups > dotnet remoting > september 2003 >

dotnet remoting : SingleCall Objects Initialising.... Please Help


hemant_mishal NO[at]SPAM yahoo.com
9/29/2003 10:42:03 PM
i am working on an application which has a middle tier to connect to
database to perform tranxactions for client, client will create
variuos proxy classes using remoting..and will call various methods..
now i want to keep all the details related to database on the server.
server will create the objects and will register them for remoting,
will also pass them connectionstring taken from configuration
file..in their constructor, all the objects are singlecall except one,
each is having two constructor one default and second taking
connectionstring, the problem is when client calls any method they are
created especially(singlecall) for him with default constructor but
connection object remains non assigned as the objects does not have
any reference to the connectionstring storage, connecting to database
throw nullreference exception ..

now i want to know which is best possible way for passing the
connections string. i had few thoughts in mind.
1. Create another remoting object which will return the connection
string through its method. this object will be created with in the
constructor..
2. hard code the connection string
3. use xml file to store and read it every time any object is
created..

thanking in advance
Bierdopje
10/1/2003 11:24:43 AM
The best way is to read your connection string from the .config file
with the AppSettingsReader every time you have to create a connection.
AddThis Social Bookmark Button