OLEDB (3) 썸네일형 리스트형 [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").ToSt.. [VB.Net] PostgreSQL OleDB 연결하기 1. OleDB 연결을 위한 ConnectString - "Provider=PostgreSQL OLE DB Provider;Data Source=DB서버 주소;location=DB명;User ID=아이디;password=비밀번호" 2. DB 연결 함수 Private gOleDBConn As OleDb.OleDbConnection Public objDA As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter() Public objDS As DataSet = New DataSet() Public strCmd As OleDb.OleDbCommand = New OleDb.OleDbCommand() Public Function DB_CONNECT() As Boolean .. [VB.Net] PostgreSQL 데이터 입력하기 1. 신규 데이터 입력하기 Dim intCount As Integer Try If DB_CONNECT() Then strCmd.Connection = gOleDBConn strCmd.CommandType = CommandType.Text strCmd.CommandText = "INSERT INTO person VALUES('" & cbRelate.Text.Substring(0, 2) & "', '" & txtName.Text & "', '" & txtBirthday.Text & "', '" & txtHomeAddr.Text & "', '" & txtHomeTel.Text & "', '" & txtComName.Text & "', '" & txtComAddr.Text & "', '" & txtComTel... 이전 1 다음