Create a Data Connection within Server Explorer, then drag&drop it on the
form.
It will create a SqlConnection with correct connection string for you.
--
Miha Markic [MVP C#] - RightHand .NET consulting & development
SLODUG - Slovene Developer Users Group
www.rthand.com
Drag&drop
"hemant" <(E-Mail Removed)> wrote in message
news:3800A4A4-28E2-45C8-944B-(E-Mail Removed)...
> Hi,
> I have been trying to connect SQL Server2000 developer edition using the
> following string.
>
> SqlConnection conn = new
> SqlConnection("server=localhost;database=pubs;uid=sa;pwd=");
>
> I dont know where i am going wrong.
>
> SQL Server Service Manager shows the following:
> Server : Hemant
> Services : SQL Server
> Running \\Hemant -MSSQLServer
>
> Even tried this command and numerous other combination but none seems to
> work.
>
> SqlConnection conn = new
> SqlConnection("server=Hemant;database=pubs;uid=sa;pwd=");
>
> I want to establish connection using SqlConnection to the database pubs
> using C# in .NET IDE.
>
> Help me out. Where am i getting it wrong?? If someone else has answered
> this question then provide me the link.
>
>
>
>
>
>
>