Skip to content

Instantly share code, notes, and snippets.

@k4m4r82
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save k4m4r82/66ace174b158f1db0bb7 to your computer and use it in GitHub Desktop.
Save k4m4r82/66ace174b158f1db0bb7 to your computer and use it in GitHub Desktop.
Private Function GetOpenConnection() As SqlConnection
Dim conn As SqlConnection = Nothing
Try
' . = localhost
' sqlexpress2008 = instance sql server
' retail = nama database
Dim strConn = "Data Source=.\sqlexpress2008;Initial Catalog=Retail;Integrated Security=True"
conn = New SqlConnection(strConn)
conn.Open()
Catch ex As Exception
End Try
Return conn
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment