게임강의

[VB.Net] PostgreSQL 데이터 조회하기

컨텐츠 정보

본문


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


관련자료

댓글 0
등록된 댓글이 없습니다.

최근글


새댓글


  • 등록자 벼배릅 등록일 04.14
알림 0