[VB.NET] MS-SQL TABLE SELECT INERT UPDATE

2018. 3. 12. 17:35IT/Visual Basic (.Net)

반응형

 

 

# [VB.NET] MS-SQL 연결 후 

- TABLE SELECT INERT UPDATE

 

- Table Name : TEST01

- VB.NET MSSQL DB 연결하는 방법 클릭

- http://rohsstory.tistory.com/372

 

- VB.NET 에서 MSSQL SELECT 하는 구문, UPDATE, INSERT 동일

    Private Sub dbselect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dbselect.Click

        Dim select_xmes As String
        select_xmes = "select * from TEST01"

        Dim comm As SqlCommand = New SqlCommand(select_xmes, optomes_con)

        Dim dr As SqlDataReader = comm.ExecuteReader()

        If (dr.Read) Then
            MsgBox(dr.Item(0).ToString)
        End If

    End Sub

반응형