V
Vincent Dalton
Hi all,
I am using ODP for .Net to build a multi-table dataset. The problem I am
running into is when I load the ZIP code table (42,741 records) into the
dataset and databind it to a combobox.
Try
' Fill the ZIP Code data table.
Dim da As New OracleDataAdapter, dr As OracleDataReader
Dim cmd As New OracleCommand("PACK_ZIP_CODES.ZIP_CODES", conORA)
With cmd
.CommandType = CommandType.StoredProcedure
.Parameters.Add(New OracleParameter("o_RESULT_SET",
OracleDbType.RefCursor, ParameterDirection.Output))
.Connection = conORA
End With
With da
.SelectCommand = cmd
.Fill(dsMulti, "ZIP_CODES")
.Fill(dsMulti, "E_ZIP_CODES")
End With
cmd.Dispose()
da.Dispose()
Catch ex As OracleException
Cursor.Current = Cursors.Default
MsgBox(ex.Message)
End Try
The form paints extremely slow. When I click on the tab that contains the
combobox, it also paints extremely slow. When I skip loading the ZIP Code
table into the dataset, the form loads quickly.
When I create a datareader based on the same ZIP Code table and load the
combobox, the form also paints very quick.
Dim cmdZIPS As New OracleCommand("PACK_ZIP_CODES.ZIP_CODES", conORA)
Dim drZIPs As OracleDataReader
With cmdZIPS
.CommandType = CommandType.StoredProcedure
.Parameters.Add(New OracleParameter("o_RESULT_SET", OracleDbType.RefCursor,
ParameterDirection.Output))
.Connection = conORA
End With
conORA.Open()
drZIPs = cmdZIPS.ExecuteReader(CommandBehavior.CloseConnection)
If drZIPs.HasRows Then
Do While drZIPs.Read()
cboH_ZIP_Code.Items.Add(drZIPs("ZIP_CODE"))
cboH_ZIP_Code.Tag = (drZIPs("CITY"))
cboE_ZIP_Code.Items.Add(drZIPs("ZIP_CODE"))
cboE_ZIP_Code.Tag = (drZIPs("CITY"))
Loop
End If
drZIPs.Close()
Unfortunately, the datareader can not be databound to the combobox. I need
to be able to:
1. Load the combobox quickly
2 Databind the combobox to the dataset
Does anybody out there have a solution?
Thanks in afvance.
Vince Dalton
I am using ODP for .Net to build a multi-table dataset. The problem I am
running into is when I load the ZIP code table (42,741 records) into the
dataset and databind it to a combobox.
Try
' Fill the ZIP Code data table.
Dim da As New OracleDataAdapter, dr As OracleDataReader
Dim cmd As New OracleCommand("PACK_ZIP_CODES.ZIP_CODES", conORA)
With cmd
.CommandType = CommandType.StoredProcedure
.Parameters.Add(New OracleParameter("o_RESULT_SET",
OracleDbType.RefCursor, ParameterDirection.Output))
.Connection = conORA
End With
With da
.SelectCommand = cmd
.Fill(dsMulti, "ZIP_CODES")
.Fill(dsMulti, "E_ZIP_CODES")
End With
cmd.Dispose()
da.Dispose()
Catch ex As OracleException
Cursor.Current = Cursors.Default
MsgBox(ex.Message)
End Try
The form paints extremely slow. When I click on the tab that contains the
combobox, it also paints extremely slow. When I skip loading the ZIP Code
table into the dataset, the form loads quickly.
When I create a datareader based on the same ZIP Code table and load the
combobox, the form also paints very quick.
Dim cmdZIPS As New OracleCommand("PACK_ZIP_CODES.ZIP_CODES", conORA)
Dim drZIPs As OracleDataReader
With cmdZIPS
.CommandType = CommandType.StoredProcedure
.Parameters.Add(New OracleParameter("o_RESULT_SET", OracleDbType.RefCursor,
ParameterDirection.Output))
.Connection = conORA
End With
conORA.Open()
drZIPs = cmdZIPS.ExecuteReader(CommandBehavior.CloseConnection)
If drZIPs.HasRows Then
Do While drZIPs.Read()
cboH_ZIP_Code.Items.Add(drZIPs("ZIP_CODE"))
cboH_ZIP_Code.Tag = (drZIPs("CITY"))
cboE_ZIP_Code.Items.Add(drZIPs("ZIP_CODE"))
cboE_ZIP_Code.Tag = (drZIPs("CITY"))
Loop
End If
drZIPs.Close()
Unfortunately, the datareader can not be databound to the combobox. I need
to be able to:
1. Load the combobox quickly
2 Databind the combobox to the dataset
Does anybody out there have a solution?
Thanks in afvance.
Vince Dalton