How to create a dynamic property for a connectionstring variable only ??
I know how to create a dynamic property for a connection object string property, by droping the connection object from the toobox onto a form and creating the dynamic property from the property list is stright forward. Then simply modifying the .exe.config file is enough to change the property from the outside.
Now my Question, Is it possible to create the configuration file for a single variable connection string that i use at module level declaration. Or should i create a componet that handle this ? if so How ? I like to know if it possible to create a connection object that uses this string by code that is accessible from different forms.
In addition Is it allowed to creat manually a config files the app.confi and .....exe.confi files ?
I kindly need someone's help ! thanks
Mostly I prefer to create INI file in format:
Just tell me the idea or post me URL that explians about it. I hopw this won't take your time. I really need some idea.
please do it....
Connection object of what?
I tried to say that if it is possible to create a dynamic property for a single variable like for example connectionstring which is declared at module without creating a componet.
If it is needed to create a componet to do this, How is it done?
Possible. but dont know how to explain in english. my english so terrible... sorry 4 that
I forgot to add for which connection object i need it for. I am trying to do it for sqlconnection object. so the connection string will be for this object..
here what i can said (if u can understand):
just imagine that u have 2 object involved in this case.
Default propertis for whole system.
it contain field,properties,function and much more. in this case we created a field for connectionstring, i name it as ConnectionString. u can do more if u want.
Every module in u r sistem will have it's own object.
like said, when u created MODULE for STAFF, so u must created module object for that.
u r object model shoud have a field for connectionstring if u want to create a dynamic connection. so name it as ConnectionString.
Now u have many object that have a ConnectionString Field and one of is a default value.
How to make it:
as a default Page.ConnectionString will take a string from .config file.
when it run a module object, system will choose with string will use like this:
IF Not MODULE.ConnectionString is Nothing THENthat all i can said, if u can understand.... :)
PAGE.ConnectionString = MODULE.ConnectionString
after this line u can make a connection to string.....
for me, it same wheather u use ADO,OLE,SQL or otherelse object because it inherit from same model.
what make it different is more function and more features. Just like u use ACCESS and SQL. u will c a different like some function can be use in ACCESS but not in SQL.
Well i couldn't able to understand your idea. May be better you rewrite it so that to grap your idea vividly.
If what you want is to call the connection from different forms you can create a class something like:
Public Class SetConnectionClass
Public sub setconnection(byval cn as sqlconnection)
Cn = new sqlconnection(“some connection”)
For calling the class just creates a new instance of the class, for example:
Dim cn as sqlconnection
Dim scnn as new SetConnectionClass
Other thing, you can use ODBC if what you want is to update the connection outside the project.
Other hand: in our cmpny we call module routines with ConnEctionString as argument, or we are initialising classes with that. So you can use that function on any connection u like... eg.:
dim Con as new OleDb.OleDbConnection(cString)
private Con as OleDbConnection 'shared between internal procdrs
Sub New(cString$, onlyShow as boolean)
Con = New ...etc
- arif ahmad replied to How to receive data in web ...
- William Thompson replied to What is the name of the Win...
- Sameera Piyadigamage replied to Point of Sale Developers: H...
- Scott Carline replied to 4 x C# Developers for large...
- Rajendra Dhakal replied to Restore SQL Server text dat...
- cloud rainda replied to How to convert between TS f...