473,395 Members | 1,437 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Populating a dropdown control

I am trying to populate a drop down on a form with the contents of a
recordset and I am getting the following values in the dropdown

System.Data.DataRowView and not the expected content that should be
appearing in there. I have stepped through the code in debug mode and
examine the value of the recordset, and the right values seem to be there.

Any idea what is causing this and how to fix it so that it does not show up
like this?

..ResetParameters()

..AddParameter("iMRN", OleDb.OleDbType.Integer, ParameterDirection.Input,
ctlHeader.PatientData("PatientMRN"))

'Pull back the list of encounters for the selected patient

If .Execute(.genuSql.StoreProcSelect, "selPatient_Billing") Then

Dim oRow As DataRow

oData = .DbData_DataTable

If .DbData_DataTable.Rows.Count > 0 Then

With drpEnc

..DataSource = oData

..DataBind()

..DataValueField = "id"

..DataTextField = "DateOfService"

End With

End If

Else

Throw New Exception(.ErrorMessage)

End If 'Encounter List
--
J.Daly
structure:interactive
Ph: 616-364-7423
Fx: 616-364-6941

http://www.structureinteractive.com

Nov 18 '05 #1
4 1331
Se the DataText and DataVauleField properties BEFORE the DataBind().

DataBind() binds your source to your control, setting what to bind after
doesn't work :)

Karl

"Irishmaninusa"
<jd***@structuctureinteractive.com.takemeoffifyouw antoemailme> wrote in
message news:u3**************@TK2MSFTNGP12.phx.gbl...
I am trying to populate a drop down on a form with the contents of a
recordset and I am getting the following values in the dropdown

System.Data.DataRowView and not the expected content that should be
appearing in there. I have stepped through the code in debug mode and
examine the value of the recordset, and the right values seem to be there.

Any idea what is causing this and how to fix it so that it does not show up like this?

.ResetParameters()

.AddParameter("iMRN", OleDb.OleDbType.Integer, ParameterDirection.Input,
ctlHeader.PatientData("PatientMRN"))

'Pull back the list of encounters for the selected patient

If .Execute(.genuSql.StoreProcSelect, "selPatient_Billing") Then

Dim oRow As DataRow

oData = .DbData_DataTable

If .DbData_DataTable.Rows.Count > 0 Then

With drpEnc

.DataSource = oData

.DataBind()

.DataValueField = "id"

.DataTextField = "DateOfService"

End With

End If

Else

Throw New Exception(.ErrorMessage)

End If 'Encounter List
--
J.Daly
structure:interactive
Ph: 616-364-7423
Fx: 616-364-6941

http://www.structureinteractive.com

Nov 18 '05 #2
I thought I had did that before and it still didn't work, but I tried it
again and this time it work. Now I have different issue, the stored
procedure I call pulls back date values in order, where the most recent date
is at the top and it goes back in order.

7/28/2004
7/1/2004
6/30/2004

This is the where the stored procedure pulls back the dates, which is
correct. However in the drop down it is being displayed as
7/28/2004
6/30/2004
7/1/2004

Why would this be like this?

"Karl" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in
message news:Oz*************@TK2MSFTNGP12.phx.gbl...
Se the DataText and DataVauleField properties BEFORE the DataBind().

DataBind() binds your source to your control, setting what to bind after
doesn't work :)

Karl

"Irishmaninusa"
<jd***@structuctureinteractive.com.takemeoffifyouw antoemailme> wrote in
message news:u3**************@TK2MSFTNGP12.phx.gbl...
I am trying to populate a drop down on a form with the contents of a
recordset and I am getting the following values in the dropdown

System.Data.DataRowView and not the expected content that should be
appearing in there. I have stepped through the code in debug mode and
examine the value of the recordset, and the right values seem to be there.
Any idea what is causing this and how to fix it so that it does not show

up
like this?

.ResetParameters()

.AddParameter("iMRN", OleDb.OleDbType.Integer, ParameterDirection.Input,
ctlHeader.PatientData("PatientMRN"))

'Pull back the list of encounters for the selected patient

If .Execute(.genuSql.StoreProcSelect, "selPatient_Billing") Then

Dim oRow As DataRow

oData = .DbData_DataTable

If .DbData_DataTable.Rows.Count > 0 Then

With drpEnc

.DataSource = oData

.DataBind()

.DataValueField = "id"

.DataTextField = "DateOfService"

End With

End If

Else

Throw New Exception(.ErrorMessage)

End If 'Encounter List
--
J.Daly
structure:interactive
Ph: 616-364-7423
Fx: 616-364-6941

http://www.structureinteractive.com


Nov 18 '05 #3
I honestly don't know. I can see that you are using OLEdbClient which I'm
no expert at. Are these Date fields or string/varchar fields? you may want
to start a new thread asking this question and identifying the
database/query/schema so that someone better suited will help.

Karl

"Irishmaninusa"
<jd***@structuctureinteractive.com.takemeoffifyouw antoemailme> wrote in
message news:e2*************@TK2MSFTNGP11.phx.gbl...
I thought I had did that before and it still didn't work, but I tried it
again and this time it work. Now I have different issue, the stored
procedure I call pulls back date values in order, where the most recent date is at the top and it goes back in order.

7/28/2004
7/1/2004
6/30/2004

This is the where the stored procedure pulls back the dates, which is
correct. However in the drop down it is being displayed as
7/28/2004
6/30/2004
7/1/2004

Why would this be like this?

"Karl" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in
message news:Oz*************@TK2MSFTNGP12.phx.gbl...
Se the DataText and DataVauleField properties BEFORE the DataBind().

DataBind() binds your source to your control, setting what to bind after
doesn't work :)

Karl

"Irishmaninusa"
<jd***@structuctureinteractive.com.takemeoffifyouw antoemailme> wrote in
message news:u3**************@TK2MSFTNGP12.phx.gbl...
I am trying to populate a drop down on a form with the contents of a
recordset and I am getting the following values in the dropdown

System.Data.DataRowView and not the expected content that should be
appearing in there. I have stepped through the code in debug mode and
examine the value of the recordset, and the right values seem to be there.
Any idea what is causing this and how to fix it so that it does not show
up
like this?

.ResetParameters()

.AddParameter("iMRN", OleDb.OleDbType.Integer,

ParameterDirection.Input, ctlHeader.PatientData("PatientMRN"))

'Pull back the list of encounters for the selected patient

If .Execute(.genuSql.StoreProcSelect, "selPatient_Billing") Then

Dim oRow As DataRow

oData = .DbData_DataTable

If .DbData_DataTable.Rows.Count > 0 Then

With drpEnc

.DataSource = oData

.DataBind()

.DataValueField = "id"

.DataTextField = "DateOfService"

End With

End If

Else

Throw New Exception(.ErrorMessage)

End If 'Encounter List
--
J.Daly
structure:interactive
Ph: 616-364-7423
Fx: 616-364-6941

http://www.structureinteractive.com



Nov 18 '05 #4
Thanks Karl, I will see what turns up. Thank you for your help to my earlier
issue.

"Karl" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in
message news:um**************@TK2MSFTNGP11.phx.gbl...
I honestly don't know. I can see that you are using OLEdbClient which I'm
no expert at. Are these Date fields or string/varchar fields? you may want to start a new thread asking this question and identifying the
database/query/schema so that someone better suited will help.

Karl

"Irishmaninusa"
<jd***@structuctureinteractive.com.takemeoffifyouw antoemailme> wrote in
message news:e2*************@TK2MSFTNGP11.phx.gbl...
I thought I had did that before and it still didn't work, but I tried it
again and this time it work. Now I have different issue, the stored
procedure I call pulls back date values in order, where the most recent

date
is at the top and it goes back in order.

7/28/2004
7/1/2004
6/30/2004

This is the where the stored procedure pulls back the dates, which is
correct. However in the drop down it is being displayed as
7/28/2004
6/30/2004
7/1/2004

Why would this be like this?

"Karl" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in
message news:Oz*************@TK2MSFTNGP12.phx.gbl...
Se the DataText and DataVauleField properties BEFORE the DataBind().

DataBind() binds your source to your control, setting what to bind after doesn't work :)

Karl

"Irishmaninusa"
<jd***@structuctureinteractive.com.takemeoffifyouw antoemailme> wrote in message news:u3**************@TK2MSFTNGP12.phx.gbl...
> I am trying to populate a drop down on a form with the contents of a
> recordset and I am getting the following values in the dropdown
>
> System.Data.DataRowView and not the expected content that should be
> appearing in there. I have stepped through the code in debug mode and > examine the value of the recordset, and the right values seem to be

there.
>
> Any idea what is causing this and how to fix it so that it does not

show up
> like this?
>
>
>
>
>
> .ResetParameters()
>
> .AddParameter("iMRN", OleDb.OleDbType.Integer, ParameterDirection.Input, > ctlHeader.PatientData("PatientMRN"))
>
> 'Pull back the list of encounters for the selected patient
>
> If .Execute(.genuSql.StoreProcSelect, "selPatient_Billing") Then
>
> Dim oRow As DataRow
>
> oData = .DbData_DataTable
>
>
>
> If .DbData_DataTable.Rows.Count > 0 Then
>
> With drpEnc
>
> .DataSource = oData
>
> .DataBind()
>
> .DataValueField = "id"
>
> .DataTextField = "DateOfService"
>
> End With
>
> End If
>
> Else
>
> Throw New Exception(.ErrorMessage)
>
> End If 'Encounter List
>
>
> --
> J.Daly
> structure:interactive
> Ph: 616-364-7423
> Fx: 616-364-6941
>
> http://www.structureinteractive.com
>
>
>



Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Lamine Darbouche | last post by:
Can anybody help? I need to have three list boxes automatically populating each other, (ie when region is selected from the first listbox, it will populate automatically the second one which is...
13
by: melih.onvural | last post by:
Group, I'm having a tough time understanding some of the previous posts on this topic so I wanted to write what I've tried and hope that you can help me troubleshoot. I have a dropdown populated...
3
by: to_rgoyal | last post by:
Hi All, I am creating one web base application using ASP.net and C#. I am populating dropdown lists of my web pages using database. I am using this code: con = new...
6
by: Casey | last post by:
hello, I need to populate a drop down list when the user clicks on the arrow button. how do i do this. Should i use a html select control or is it possible using the asp:dropdownlist
1
by: Patrick.O.Ige | last post by:
Doing the simple DropDown List binding using the method NextResult() But its just not populating .. what am i missing Its populating the 3 DropDwonList but no Data? Private Sub...
1
by: asad | last post by:
Hello, i want to populate the drop down box values based on the first drop down box value, actually i have form in which user will select a car maker and based on that value below 2 drop down...
1
by: Mike P | last post by:
I am populating a drop down column in a datagrid on page load. Here is my code : <asp:TemplateColumn> <ItemTemplate> <asp:DropDownList ID="ddlUserName" Font-Name="Verdana" Font-Size="8pt"...
2
by: mamun | last post by:
Hi All, The problem is as follows: I have a table from where I am getting consultant's name and populating the dropdown list control. But I want to populate the default one which I got it as...
0
by: koonda | last post by:
Hi all, I have a Project due after one week. It is a web service project. I have a Web Form which communicates to the web service and this web service communicates to the database. I have all my...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.