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 Basic
  4. Data providers List in combo box

Data providers List in combo box

Scheduled Pinned Locked Moved Visual Basic
databasecsharpc++sql-serveroracle
2 Posts 2 Posters 0 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.
  • S Offline
    S Offline
    salaikumar
    wrote on last edited by
    #1

    Hi all In C#.net or vc++ .net windows application, I want to have a list of data providers(like Microsoft OLE DB Provider for SQL Server,Microsoft OLE DB Provider for Oracle,Microsoft Access etc) in a combo box. So that I can connect to any database...How is it possible.... please help salai

    Salai

    A 1 Reply Last reply
    0
    • S salaikumar

      Hi all In C#.net or vc++ .net windows application, I want to have a list of data providers(like Microsoft OLE DB Provider for SQL Server,Microsoft OLE DB Provider for Oracle,Microsoft Access etc) in a combo box. So that I can connect to any database...How is it possible.... please help salai

      Salai

      A Offline
      A Offline
      ajay58886
      wrote on last edited by
      #2

      Imports System.Data.SqlClient Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ' Creating connection and command sting Dim conStr As String = "Provider=Microsoft.JET.OLEDB.4.0;data source=c:\\northwind.mdb" Dim sqlStr As String = "SELECT * FROM Employees" ' Create connection object Dim conn As OleDbConnection = New OleDbConnection(conStr) ' Create data adapter object Dim da As OleDbDataAdapter = New OleDbDataAdapter(sqlStr, conn) ' Create a dataset object and fill with data using data adapter's Fill method Dim ds As DataSet = New DataSet da.Fill(ds, "Employees") ' Attach dataset's DefaultView to the datagrid control DataGrid1.DataSource = ds.DefaultViewManager End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click ' Creating connection and command sting Dim conStr As String = "Provider=Microsoft.JET.OLEDB.4.0;data source=c:\\northwind.mdb" Dim sqlStr As String = "SELECT * FROM Employees" ' Create connection object Dim conn As OleDbConnection = New OleDbConnection(conStr) ' Create data adapter object Dim da As OleDbDataAdapter = New OleDbDataAdapter(sqlStr, conn) ' Create a dataset object and fill with data using data adapter's Fill method Dim ds As DataSet = New DataSet da.Fill(ds, "Employees") ' Attach dataset's DefaultView to the datagrid control Dim dv As DataView = ds.Tables("Employees").DefaultView ListBox1.DataSource = dv ListBox1.DisplayMember = "FirstName" End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click ' Creating connection and command sting Dim conStr As String = "Provider=Microsoft.JET.OLEDB.4.0;data source=c:\\northwind.mdb" Dim sqlStr As String = "SELECT * FROM Employees" ' Create connection object Dim conn As OleDbConnection = New OleDbConnection(conStr) ' Create data adapter object Dim da As OleDbDataAdapter = New OleDbDataAdapter(sqlStr, conn) ' Create a dataset object and fill with data using data adapter's Fill method Dim ds As DataSet = New DataSet da.Fill(ds, "Employees") ' Attach dataset's DefaultView to the datagrid control Dim dv As DataView = ds.Tables("Employees").DefaultView ComboBox1.DataSource = dv ComboBox1.DisplayMember = "FirstName" End Sub :rolleyes:BYE

      Imagine the I.T

      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