Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Studio
  4. VB.NET - Firebird ODBC adapter fill datagrid.

VB.NET - Firebird ODBC adapter fill datagrid.

Scheduled Pinned Locked Moved Visual Studio
databasecsharpwinformshelp
2 Posts 2 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Marcus Genovese
    wrote on last edited by
    #1

    I am developing a Windows Forms application with firebird DB using ODBC driver to connect to the database and should fill a DataGrid with the results of a query; This is the code but I do not work in ..... what am I wrong? Private Sub Form1_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown Dim cn As OdbcConnection cn = New OdbcConnection("dsn=PHOENIXDB;uid=SYSDBA;pwd=masterkey;") Dim mystring As String = "Select * from SSN_REGIONE" Dim cmd As OdbcCommand = New OdbcCommand(mystring) Dim daSSNregione As New OdbcDataAdapter Dim dsSSNregione As New DataSet cn.Open() Try daSSNregione.SelectCommand = cmd daSSNregione.Fill(dsSSNregione) DataGridViewX1.DataSource = dsSSNregione Catch ex As Exception MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "Connection Error !!") End Try cn.Close() End Sub

    D 1 Reply Last reply
    0
    • M Marcus Genovese

      I am developing a Windows Forms application with firebird DB using ODBC driver to connect to the database and should fill a DataGrid with the results of a query; This is the code but I do not work in ..... what am I wrong? Private Sub Form1_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown Dim cn As OdbcConnection cn = New OdbcConnection("dsn=PHOENIXDB;uid=SYSDBA;pwd=masterkey;") Dim mystring As String = "Select * from SSN_REGIONE" Dim cmd As OdbcCommand = New OdbcCommand(mystring) Dim daSSNregione As New OdbcDataAdapter Dim dsSSNregione As New DataSet cn.Open() Try daSSNregione.SelectCommand = cmd daSSNregione.Fill(dsSSNregione) DataGridViewX1.DataSource = dsSSNregione Catch ex As Exception MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "Connection Error !!") End Try cn.Close() End Sub

      D Offline
      D Offline
      den2k88
      wrote on last edited by
      #2

      Wrong section - post it under VisualBasic section. Please wrap your code in a preformatted block fo the ease of reading. Please do not crosspost between Forums and Quick Answers. What does it menas "it doesn't work"? Does not compile? Does not fill? Returns an error? Try using the debugger to see if the connection is open for example.

      Geek code v 3.12 {      GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- r++>+++ y+++*      Weapons extension: ma- k++ F+2 X }

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups