Re: how to disable an AdoConnection




"tdrgabi" <tdrgabi@xxxxxxxxx> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:44bb5b37$1@xxxxxxxxxxxxxxxxxxxxxxxxx

the problem is that i need the connection string because in design mode i
open the datasets , when im building the grids columns to see if the data
is shown correct, or when im doing a raport file in raport designer.

and if i will relly on manually removing the connection string every time
i build a version (often) ... sometimes im gonna forget and the clients
will get the nice error at start.

i was thinking if i can stop from code the connection from connecting ...
something like having a flag CanConnect and setting it only after i choose
the server and password.

now i need a way to stop the connection from connecting i tryied on
BeforeConnect if CanConnect=false then Abort ... but it still connects ...

removing the connection string in before connect doesnt help, because i
think it already uses it, because even if i make the string empty in
before connect ,.... it still connects.
AFAIK you are replacing DesignTime connection string with new one at
runtime, I am suggesting you to do that in BefforeConnect event. Thus you
will connect to proper DB even if you will forget to disconnect at design
time.

If this is not an option for you, you can try to subclass TADOConnection and
manipulate there with StreamedConnected property.


.



Relevant Pages

  • Re: Security in windows forms apps
    ... On another note since this is an internal app I am not too worried about it ... You need to ensure that your not setting these values at design time. ... I have encrypted the connection string in the app.config file, ... rename the exe to .txt. So it will now be app.txt. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: DynamicProperties connection string not working in inherited form in design mode
    ... configuration file after the InitializeComponent has been called. ... An other attempt could be to set up the connection string in the OnFormLoad ... The message I get when attempting to open Form2 (derived form from Form1 ... You should now receive the message in the design window: ...
    (microsoft.public.dotnet.framework.windowsforms.designtime)
  • Connection String Opinion?
    ... I'm having a design brain-cramp. ... I have an app that needs to have a connection string that can changed by the ... (basically the same app needs to be able to talk to different ... use the design time UI much if I keep going the way I'm going (like for grid ...
    (microsoft.public.dotnet.languages.csharp)
  • TADOConnection
    ... During design, on my office machine, I fill in the ... The program has an INI file where the database location is stored for ... shows the location of the database if no INI file is found. ... forget to empty the connection string for the ADOConnection component, ...
    (borland.public.delphi.database.ado)