DropDownList with Dataset from OleDBConnection NOT display records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've created an OleDBConnection with a corresponding dataAdapter and a
dataSet. In development I am able to retrieve records and display them fine.
Once compiled no records are returning. I'm loading the recordset in
Page_Load event:

DatSet.Clear()
dataAdapter.Fill(DataSet)

Microsft recommended using DataBind( ) but everytime I call theat function I
get a compile error. This is an ASP .NET web form. Help please, I'm getting
nowhere and Microsoft's "support" is USELESS.
 
Roman,

With your code you show that you fill a dataset to from a database.

However you tell you load a recordset to a page. ???????????? I do not
understand that.

What you can do as one as the possibilities is set the dataset as a
datasource for a datagrid something as

Datagrid1.datasource = Dataset
Datagrid1.databind

I hope this helps?

Cor
 
Roman,

I see now in the subject that it is about a dropdownlist than it can be (I
would not use the name dataset)

\\\
DropDownList1.DataSource = ds.Tables(0)
DropDownList1.DataTextField = "mycolumn1"
DropDownList1.DataMember = "mycolumn2"
DropDownList1.DataBind()
///

I hope this helps?

Cor
 
I've tried both of these methods and when I comile I receive "Specified
argument was out of the range of valid values. Parameter name: value". On
another note, I'm not using the actual name dataSet, it's just there as an
example.
 
Roman,

Show me that code, so it is impossible to see something, sometimes it is
just a simple thing as a uppercase

Cor
 
If I try to use DataBind( ) I get a compile error. I use this and I get no
records returned.

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

'Put user code to initialize the page here


DsUsers1.Clear()
dataAdapterUsers.Fill(DsUsers1)


DsSystems1.Clear()
dataAdapterSystems.Fill(DsSystems1)



dateBox.Text = Date.Today



End Sub
 
I had to remove it. It appears that I'm OK when I have only one dataAdapter
with one dataSet. When I add another dataAdapter with another dataSet is
when I'm encountering the problem. In other words, this works:

DsUsers1.Clear()
SqlDataAdapter1.Fill(DsUsers1)

DataBind()

But this does not:

DsUsers1.Clear()
SqlDataAdapter1.Fill(DsUsers1)

DsSytems1.Clear()
SqlDataAdapter2.Fill(DsSytems1)

DataBind()
 
Roman,

It seems to me that you have set everyting in the designer, that I cannot
see, check that again, and use than as well instead of databind only.

the control (your dropdonw). databind

Cor

"(e-mail address removed)"
..
 
I apologize for wasting your time. I resolved this problem. Apparently
soemthing was corrupt in the project itself. I started from scratch and am
now running fine. On to a new problem. Thanks for the assist.
 
Back
Top