I am trying to connect to sql server using vb.net but I got this error:
Value of type ‘System.Data.SqlClient.SqlConnection’ cannot be converted to ‘1-dimensional array of System.Data.SqlClient.SqlConnection’.
this is the cod source:
Imports System.Data.SqlClient
Public Class Form1
Dim connection As SqlConnection()
Dim reader As SqlDataReader
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
connection = New SqlConnection("data source=.; initial catalog=tp2_ado; integrated security = sspi")
Catch ex As Exception
MessageBox.Show(ex.Message())
End Try
End Sub
End Class
1 Answer