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."

Re: Connection string by Miha

Miha
Fri Oct 01 04:56:55 CDT 2004

Hi Nexus,

Try with this one (from www.connectionstrings.com):
Data Source=(local);Initial Catalog=pubs;Integrated Security=SSPI;"
Or even better, drag & drop connection from Server Explorer on the form
(perhaps in a test project) and see what wizard creates for you.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"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."
>
>



Re: Connection string by Mythran

Mythran
Fri Oct 01 10:59:46 CDT 2004

Try "Server=(local);Database=Olympia;Integrated Security=True;"

Mythran



"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."
>
>



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."
>
>