Home All Groups Group Topic Archive Search About
Author
1 Apr 2005 8:55 PM
TS
I configured a data adapter and generated a dataset and wrote the code to
fill the dataset with data coming from an SQL database table when my form
loads. I also changed the DataSource of a combo box to point to the
dataset.tablename and changed the DisplayMemebr to point at a column. After
the form loads nothing is populated in the combo box? Is there something I'm
missing. Please help
--
TS

Author
2 Apr 2005 1:20 AM
Ken Tucker [MVP]
Hi,

           Here is an example.

Dim strConn As String

Dim strSQL As String

Dim ds As New DataSet

Dim da As OleDbDataAdapter

Dim conn As OleDbConnection

strConn = "Provider = Microsoft.Jet.OLEDB.4.0;"

strConn &= "Data Source = Northwind.mdb;"

conn = New OleDbConnection(strConn)

da = New OleDbDataAdapter("Select * From Categories", conn)

da.Fill(ds, "Categories")

ComboBox1.DataSource = ds.Tables("Categories")

ComboBox1.DisplayMember = "Description"



Ken

--------------------------

"TS" <T*@discussions.microsoft.com> wrote in message
news:9A425555-253B-44E7-A354-B920CF75D580@microsoft.com...
I configured a data adapter and generated a dataset and wrote the code to
fill the dataset with data coming from an SQL database table when my form
loads. I also changed the DataSource of a combo box to point to the
dataset.tablename and changed the DisplayMemebr to point at a column. After
the form loads nothing is populated in the combo box? Is there something I'm
missing. Please help
--
TS
Author
4 Apr 2005 10:09 PM
TS
Thanks for your reply. I tried the code you sent me and it generated the
following error message: "Unhandled Exception:
System.Data.OleDb.OleDbException: Multiple-step OLE DB operation generated
errors. Check each OLE DB status value, if available. No work was done.

Here is the code:

Dim strConn As String

        Dim strSQL As String

        Dim SscIntake1 As New DataSet()

        Dim da As OleDb.OleDbDataAdapter

        Dim conn As OleDb.OleDbConnection

        strConn = "Provider = Microsoft.Jet.OLEDB.4.0;"
        strConn &= "Data Source = Persist Security Info=true;Integrated
Security=false;User ID=sa;Password=xxx;database=SSC;server=zzz;"

        conn = New OleDb.OleDbConnection(strConn)

        da = New OleDb.OleDbDataAdapter("Select * From qmf_cint", conn)

        da.Fill(SscIntake1, "qmf_cint")

        ComboBox1.DataSource = SscIntake1.Tables("qmf_cint")

        ComboBox1.DisplayMember = "Last_Name"

Show quoteHide quote
"Ken Tucker [MVP]" wrote:

> Hi,
>
>            Here is an example.
>
> Dim strConn As String
>
> Dim strSQL As String
>
> Dim ds As New DataSet
>
> Dim da As OleDbDataAdapter
>
> Dim conn As OleDbConnection
>
> strConn = "Provider = Microsoft.Jet.OLEDB.4.0;"
>
> strConn &= "Data Source = Northwind.mdb;"
>
> conn = New OleDbConnection(strConn)
>
> da = New OleDbDataAdapter("Select * From Categories", conn)
>
> da.Fill(ds, "Categories")
>
> ComboBox1.DataSource = ds.Tables("Categories")
>
> ComboBox1.DisplayMember = "Description"
>
>
>
> Ken
>
> --------------------------
>
> "TS" <T*@discussions.microsoft.com> wrote in message
> news:9A425555-253B-44E7-A354-B920CF75D580@microsoft.com...
> I configured a data adapter and generated a dataset and wrote the code to
> fill the dataset with data coming from an SQL database table when my form
> loads. I also changed the DataSource of a combo box to point to the
> dataset.tablename and changed the DisplayMemebr to point at a column. After
> the form loads nothing is populated in the combo box? Is there something I'm
> missing. Please help
> --
> TS
>
>
>
Author
2 Apr 2005 6:37 AM
Cor Ligthert
TS,

Show a little piece of code, (first without the designer part).
(And please first pasted in a notebook and copied back to make it readable)

(I assume that you bind in the desiger and that you told in that wich
*datatable*, often is the wrong point taken to do that, so you can check
that first)

Cor