Re: reuse connection object with diff username passwor ...

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



See >>>

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
-----------------------------------------------------------------------------------------------------------------------

<jtbm> wrote in message news:e$q11H3DHHA.4404@xxxxxxxxxxxxxxxxxxxxxxx
Yes this is a 'thick' winforms client. Well I went ahead and restructured
my app to create a new connection object instance everytime I need a
username change, rather then trying to reuse an existing connection object
by changing its connectionstring. Things are working good now.

Good...

But this is just one more case that makes ado.net designers/design time
development useless. I have decided to remove my connection completely
from designer and create it in code now. I already had a problem where
once ConnectionString is set in InitializeComponent() any following code
that assigns the connection to a command object initiates database
communications... and you have no control over this because it depends on
serialization order of designer generated code!! HELLO!@# dont talk to the
database until i ask for it **** it!!#

..I have several other issues with ado.net designers too. I wish I had
done everything in code right from the beginning. Seriously is anyone able
to use these in a real project? I just use them in a separate dummy
project to generate code, then I copy and paste the code. I can see being
able to use them for simple asp.net stuff I guess.

I have to agree. These are the same conclusions I came to in my new
book. The data access code is not that hard to write--especially if you
can leverage it over time. You'll find that the Windows Forms
application is having a comeback. I've also found that the Visual Studio
code generators (there aren't any in ADO.NET), are okay for the
simpliest of applications. You'll quickly outgrow them with more
sophisticated designs.


---
Posted via DotNetSlackers.com


.



Relevant Pages

  • Re: Problem mit Dataset-Objekt und Access-Datenbank
    ... darüber gemacht, welchen Code dieser Designer ... Code dann enthält. ... um eine Connection zu einer solchen DB herzustellen. ... Ich sehe dann den Inhalt der Datenbank. ...
    (microsoft.public.de.german.entwickler.dotnet.vb)
  • 1999 Spirito St
    ... We mean the existing designer. ... Linette equally exhausts the complication? ... May will you spot the islamic principal sleeves before Abduljalil does? ... thrusts in connection with their passage. ...
    (sci.crypt)
  • Re: reuse connection object with diff username passwor ...
    ... Ah, and yes, I agree with both: designer is just for simple apps and demos. ... my app to create a new connection object instance everytime I need a username change, rather then trying to reuse an existing connection object by changing its connectionstring. ... I have decided to remove my connection completely from designer and create it in code now. ...
    (microsoft.public.dotnet.framework.adonet)
  • RE: SqlConnection Object Keeping Reappearing
    ... You may be enlightened if you take a look at the "web designer generated ... When you have connection objects ... connection string object to contain the connection string that has been ... Before I implemented this SQLConnection String into web.config, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Component cant find connection string
    ... connection, a data data adapter, a dataset, and a few commands. ... How can the component designer find the config setting, ... Even getting that error message is a bit tricky. ...
    (microsoft.public.vsnet.general)