Click here to Skip to main content
15,922,155 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Keeping the position on the page Pin
HimaBindu Vejella8-May-06 22:37
HimaBindu Vejella8-May-06 22:37 
QuestionError: "Base class includes the field xxx but its type yyy is not compatible with the type of control yyy Pin
leckey8-May-06 8:34
leckey8-May-06 8:34 
AnswerRe: Error: "Base class includes the field xxx but its type yyy is not compatible with the type of control yyy Pin
ToddHileHoffer8-May-06 8:45
ToddHileHoffer8-May-06 8:45 
QuestionRe: Error: "Base class includes the field xxx but its type yyy is not compatible with the type of control yyy Pin
leckey8-May-06 9:10
leckey8-May-06 9:10 
QuestionConnect to ADS in ASP and ASP.Net Pin
csri8-May-06 8:31
csri8-May-06 8:31 
AnswerRe: Connect to ADS in ASP and ASP.Net Pin
HimaBindu Vejella8-May-06 22:41
HimaBindu Vejella8-May-06 22:41 
GeneralRe: Connect to ADS in ASP and ASP.Net Pin
csri8-May-06 23:37
csri8-May-06 23:37 
QuestionSQLDataReader data binding error = frustrated! Pin
Kerberos258-May-06 8:29
Kerberos258-May-06 8:29 
I get this error: "Invalid attempt to FieldCount when reader is closed." on the databind() method when the following code is run:
Private Sub loadProject()
   Dim objDR As SqlDataReader
   Dim objConn As New SqlConnection(strConn)
   Dim objSQL As New SqlCommand("SELECT * FROM Projects ORDER BY Priority DESC, ProjectID DESC", objConn)

   objConn.Open()

   objDR = objSQL.ExecuteReader
   grdDisplay.DataSource = objDR
   grdDisplay.DataBind() <--Error occurs here

   If grdDisplay.Items.Count = 0 Then
       grdDisplay.Visible = False
       lblMessage.Text = "No projects found."
   Else
       grdDisplay.Visible = True
   End If

   objDR.Close()
   objConn.Close()
End Sub 

This code is called directly from the Page_Load event on the first page after login so there are no prior database calls that could close the connection. When I step through the code in VS the autos window shows the objDR IsClosed property is FALSE at the time the databind() method is called.

This same code (different SQL strings) works fine everywhere else in the app. Also it has been working fine all along and just simply stopped working. The only change I made was moving the database and thus adjusting the connection string (which works fine elsewhere.

What am I missing?

Thank you in advance for any suggestions!

Peter

-- modified at 14:37 Monday 8th May, 2006
AnswerRe: SQLDataReader data binding error = frustrated! Pin
ToddHileHoffer8-May-06 8:39
ToddHileHoffer8-May-06 8:39 
GeneralRe: SQLDataReader data binding error = frustrated! Pin
Kerberos258-May-06 8:47
Kerberos258-May-06 8:47 
GeneralRe: SQLDataReader data binding error = frustrated! Pin
ToddHileHoffer8-May-06 8:58
ToddHileHoffer8-May-06 8:58 
GeneralRe: SQLDataReader data binding error = frustrated! Pin
Kerberos258-May-06 9:10
Kerberos258-May-06 9:10 
QuestionDo something before Page Closing Problem.. Pin
cheeken2u8-May-06 7:00
cheeken2u8-May-06 7:00 
AnswerRe: Do something before Page Closing Problem.. Pin
ToddHileHoffer8-May-06 8:17
ToddHileHoffer8-May-06 8:17 
GeneralRe: Do something before Page Closing Problem.. Pin
CWIZO8-May-06 10:16
CWIZO8-May-06 10:16 
AnswerRe: Do something before Page Closing Problem.. Pin
TheManFran8-May-06 18:50
TheManFran8-May-06 18:50 
AnswerRe: Do something before Page Closing Problem.. Pin
HimaBindu Vejella8-May-06 23:35
HimaBindu Vejella8-May-06 23:35 
AnswerRe: Do something before Page Closing Problem.. Pin
Bhasker Pinninti9-May-06 3:10
Bhasker Pinninti9-May-06 3:10 
QuestionCheckBoxList Pin
sroberts828-May-06 6:47
sroberts828-May-06 6:47 
AnswerRe: CheckBoxList Pin
ToddHileHoffer8-May-06 8:28
ToddHileHoffer8-May-06 8:28 
QuestionFormatting number string Pin
Ista8-May-06 5:50
Ista8-May-06 5:50 
AnswerRe: Formatting number string Pin
Paddy Boyd8-May-06 6:16
Paddy Boyd8-May-06 6:16 
GeneralRe: Formatting number string Pin
Ista8-May-06 6:18
Ista8-May-06 6:18 
AnswerRe: Formatting number string Pin
Jon Sagara8-May-06 7:06
Jon Sagara8-May-06 7:06 
GeneralRe: Formatting number string Pin
Ista8-May-06 8:22
Ista8-May-06 8:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.