Re: Connection string by William
William
Fri Oct 01 14:00:20 CDT 2004
ALWAYS add a Try/Catch block to a connection attempt. This will provide the
exception message that tells you what's REALLY going on.
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
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.
__________________________________
"Nexus" <Nexus@discussions.microsoft.com> wrote in message
news:1C48445E-AC2C-485D-B529-A37618BBF1AE@microsoft.com...
> Dim conn As New SqlConnection
> Dim comm As New SqlCommand
>
> conn.ConnectionString = "Data Source =(local);Initial
> Catalog=Olympia;Integrated Security=True;"
>
> conn.Open()
> comm.Connection = conn
>
> Is there anything wrong with the above codes? Are there any solutions to
> the
> stated error? Because when I run the program, I receive the following
> error,
> which points to line 4 of the above codes (conn.Open()):
>
> "An unhandled exception of type 'System.Data.sqlClient.sqlException'
> occurred in system.data.dll'. Additional Information: System error."
>
>