Imports System.Data.SqlClient
Public NotInheritable Class SUSU
Public Shared StrConn As String = "data source=NICK-717455AAD2\SQLEXPRESS;Database = Revenue;integrated security = ture"
End Class
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim cn As New SqlConnection(StrConn) Error ตรงนี้อ่ะครับ เหมือนมันยังเชื่อมไม่ได้
Dim sql As String = ""
sql = "Select * from Revenue"
Dim da As New SqlDataAdapter(sql, cn)
Dim ds As New DataSet
cn.Open()
da.Fill(ds, "Pro")
DataGridView1.DataSource = ds.Tables("Pro")
End Sub
End Class