HOW TO CONNECT SQL DATABASE SERVER TO VB.NET?

Ankita Pandey

Total Post:183

Points:1285
Posted by  Ankita Pandey
 1022  View(s)
Ratings:
Rate this:
how to connect sql database server to vb.net?
  1. Pravesh Singh

    Post:412

    Points:2888
    Re: How to connect sql database server to vb.net?

    You can hardcode it like this
     Collapse | Copy Code
    var connection = New System.Data.SqlClient.SqlConnection(connectionString)
    connection.Open()

    or you can do it more independently 

    var factory = System.Data.Common.DbProviderFactories.GetFactory(providerString)
    var connection = factory.CreateConnection()
    connection.ConnectionString = connectionString
    connection.Open()

      Modified On Oct-21-2014 12:47:04 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!