Re: Help -- SQLConnection Problem



Michael,



This will help you setting up your connection string.

http://www.connectionstrings.com/



What do you mean by "copy all the properties of that SQLConnection object to
a new SQLConnection"? Do you really mean all? Do you now have two
SQLConnection Objects having the same name? If you could provide us with the
error message you get it would me much easier to find a solution to your
problem.

Basically I agree to what Jordan said. What I usually do is dragging a
SQLConnection of my form, copy the connection string, delete the
SQLConnection again and then create the SQLConnection in code behind using
the connection string I copied (I always forget about
theconnectionstrings.com).



You should also have a look at the msdn reference which comes with some nice
examples:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDataSqlClientSqlConnectionClassConnectionStringTopic.asp





Does this help?



Daniel Walzenbach





"Michael D Murphy" <mdmurphy@xxxxxxxxxxxxxxxxxxxxx> schrieb im Newsbeitrag
news:exXGo2LsFHA.1252@xxxxxxxxxxxxxxxxxxxxxxx
> Hi,
> I continually have problems with SQLConnections. Once I fix the one that I
> am having problems with I move on. I would rather have more confidence. I
> must be not understanding something or another. If I drag a SQLConnection
> to the form and configure it and then drag a SQLDataAdapter to the form
> and configure that, then right click on the SQLAdapter and click on
> Preview Data, I always get the data. But if I use that exact SQLConnection
> object or copy all the properties of that SQLConnection object to a new
> SQLConnection object, and try to connect I get errors. Why would it work
> one way and not the other. If you could point me to a SQLConnection primer
> or other tutorial that will finally get me past these problems, I would
> appreciate it.
> Thanks for your time,
> Michael
> 954-452-1047
>


.



Relevant Pages

  • Re: Help -- SQLConnection Problem
    ... Michael ... > This will help you setting up your connection string. ... > What do you mean by "copy all the properties of that SQLConnection object ... >> SQLConnection object or copy all the properties of that SQLConnection ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Help -- SQLConnection Problem
    ... SQLConnection but when I run into connection problems I revert back to the ... drag and drop the SQLConnection Object from the toolbox onto the page. ... Michael ... > This will help you setting up your connection string. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Help -- SQLConnection Problem
    ... open query analyser and change to the database you are interested in. ... connection string will be used... ... >> What do you mean by "copy all the properties of that SQLConnection object ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Factory and Garbage Collection
    ... The only potential problem I see here is that a SqlConnection must be closed ... When there are no longer any more reference to it. ... or is the garbage collector smart enough to know ... SqlConnection object being collected right away because you passed its ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Login failed for user foo but the SQL executed correctly
    ... directly uses SqlConnection, SqlCommand, etc. to call the stored procedure. ... | existing SqlConnection object, with the SqlHelper class, in the same ... Maybe the SqlHelper class leaves ... | connection object, so I am going to see if that works first. ...
    (microsoft.public.sqlserver.security)

Loading