drop down problem

Z

zoom14151

I'm new to asp.net and I'm having a problem with a dropdown list that
is populated from a sql statement. The dropdown select a column in a
table and after the dropdown is populated the user can select a value
from the dropdown and displays the record inside a datagrid. I used
the same code on another page and it worked fine. The problem is that
the dropdown displays System.Data.Command.DbDataRecord several times in
the dropdown. I tried debugging and the select statement is formated
correct. Can anyone tell me what i'm doing wrong.
 
M

Michael Tkachev

Hi

Please show your code

Sincerely yours,
Michael B. Tkachev.
(e-mail address removed)
 
Z

zoom14151

Michael said:
Hi

Please show your code

Sincerely yours,
Michael B. Tkachev.
(e-mail address removed)

Private Sub ReadOwner()
Dim oConn As New SqlConnection(Session("ConnProvStr"))
Dim oComm As New SqlCommand
Dim oSQLDataAdapter As SqlDataAdapter
Dim dsOwner As DataSet



'prepare command object
oComm.Connection = oConn
oComm.CommandType = CommandType.StoredProcedure
oComm.CommandText = "ReadOwner"

'open connection
oConn.Open()

'prepare data adapter object
oSQLDataAdapter = New SqlDataAdapter
oSQLDataAdapter.TableMappings.Add("Table", "LiscPlate")
oSQLDataAdapter.SelectCommand = oComm

'initialize dataset
dsOwner = New DataSet("Owner")
oSQLDataAdapter.Fill(dsOwner)

'prepare dataview to sort
Dim dvIncident As DataView
dvIncident = New DataView(dsOwner.Tables("LiscPlate"))
ddOwner.DataSource = dvIncident
ddOwner.DataBind()

'close connection
oConn.Close()
 
Z

zoom14151

I have to change what the dropdown list is showing
"System.Data.DataRowView Sorry, I changed the code that I displayed
above.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,161
Latest member
GertrudeMa
Top