title: Connection to SQL Server not Working
body: <p>I using vb.net 2010 and sql server management express 2008. bu I little confused what is wrong with the code for connect sql and vb.net</p>
  
  <pre><code>Imports System.Data.SqlClient
  
  Module Module1
    Public Class connection
      Public Function GetConnect()
        Dim conn As SqlConnection = Nothing
        Dim connString As String = "Data Source=.\SQLEXPRESS; Initial  Catalog=dbMedical;Integrated Security=true"
        conn = New SqlConnection(connString)
        conn.Open()
        If conn.State &lt;&gt; ConnectionState.Open Then
          Return False
        Else
          Return True
        End If
      End Function
    End Class
  End Module
  </code></pre>
  
  <p>but but it does not work, error message appears.</p>