[VB.Net] PostgreSQL 데이터 조회하기
컨텐츠 정보
- 1,301 조회
본문
1. 테이블에서 데이터 조회
Dim intCount As Integer
Try
If DB_CONNECT() Then
strCmd.Connection = gOleDBConn
strCmd.CommandType = CommandType.Text
strCmd.CommandText = "SELECT * FROM code"
objDA.SelectCommand = strCmd
objDA.Fill(objDS, "code")
With objDS.Tables("code")
For intCount = 0 To .Rows.Count - 1
cbRelate.Items.Add(.Rows(intCount).Item("c_code").ToString & " : " & .Rows(intCount).Item("c_value").ToString)
Next
End With
Call DB_DISCONNECT()
Else
MessageBox.Show("DB 연결을 확인하십시오!", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
Catch ex As Exception
MessageBox.Show(ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error)
Call DB_DISCONNECT()
End Try
출처 : http://parkgunstyle.kr/5
관련자료
-
이전
-
다음