Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataReader Problem

Status
Not open for further replies.

ac11nyc

Programmer
Oct 1, 2003
94
US
Dim SelectCMD As New SqlCommand("SELECT BreakpointStep, BreakpointValue, Rate_BP * .01 AS Rate FROM FEE_SCHEDULE_DEFAULT WHERE (AccountType = 1) AND (BreakpointStep > 0) AND (ScheduleId = '000009');" & _
"SELECT BreakpointStep,BreakpointValue, Rate_BP * .01 AS Rate FROM FEE_SCHEDULE_DEFAULT WHERE (AccountType = 2) AND (BreakpointStep > 0) AND (ScheduleId = '000009')", sqlConn)
sqlConn.Open()
Dim drStatus As SqlDataReader = SelectCMD.ExecuteReader
If drStatus.HasRows Then
With dgEquity
.DataSource = drStatus
.DataBind()
End With
drStatus.NextResult()
With dgFixedIncome
.DataSource = drStatus
.DataBind()
End With
End If
drStatus.Close()
sqlConn.Close()
Catch ex As Exception
Response.Write(ex.Message)
End Try


Can someone please tell me what i am doing wrong here because its telling me that the state of the connection is already open. When i comment out the sqlConn.open, im not getting any records when i know there are atleast 5. Any help will be greatly appreciated.
 
You are opening your connection after your command. Try following this example faq855-5662


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top