Sql Server Connection String for VB.net

  • 13 years ago

    hi ,


    can anybody help me out,pls !!!

    i need SQL Server Connection String for VB.net


  • 13 years ago

    Hi Sekkeena
    in web.config

      <remove name="Connect"/>
      <add name="connect" connectionString="server=AlohaMora; database=dbAloha; uid=sa; pwd=aloha;"/>
    Now u can use it in your webpages as

    Dim conn As New SqlConnection(ConfigurationManager.ConnectionStrings("connect").ConnectionString)
    and when u need the connection just type


    <do needfull >


    Hope it helps

  • 13 years ago



    actually i not making a web application.this is a desktop application, so how can i use it.


  • 13 years ago


    it is simple.Just use this as  connection string by providing ur server name,database name along with its user id and pwd.

    dim con as new sqlconnection("server=servername;user id=u;password=pwd;;Database=DBase")

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“An idiot with a computer is a faster, better idiot” - Rich Julius