絞り込み条件を変更する
検索条件を絞り込む

すべてのカテゴリ

1 件中 1 - 1 件表示
カバー画像

VB.NET (.VB) ポスグレに接続 SQL 実行

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load  '*********************************************************************  ' Form1 を Load した時のイベント 押した処理  '*********************************************************************         ' ポスグレ接続         Dim Con As NpgsqlConnection = Nothing         ' クラス ClassDB から 接続文字列を取得 (接続文字列を入れればOK)         Con = New NpgsqlConnection(ClassDB.ConString)         Con.Open()         ' コマンド         Dim Cmd As NpgsqlCommand = New NpgsqlCommand("select id, name, ranking,group_name from countries;", Con) ' SQL の結果を格納する         Dim rs As NpgsqlDataReader ' SQL 実行         rs = Cmd.ExecuteReader         rs.Read()         txthyouji.Text = rs
0
1 件中 1 - 1