wooi83

wooi83

  • NA
  • 18
  • 0

Runtime Error: Object reference not set to an instance of an object. --> please help me

Mar 29 2004 12:20 PM
int bookID = int.Parse(txtboxSearchbyISBN.Text); dsBookISBN = SearchData.ListBookByISDN(bookID); DataSet dsBookISBN = new DataSet(); Services SearchData = new Services(); DataRow dr; int bookID = int.Parse(txtboxSearchbyISBN.Text); dsBookISBN = SearchData.ListBookByISDN(bookID); try{ dr = dsBookISBN.Tables["Table"].Rows[0]; //<----- i have errors on this line lbltitle.Text= "Book Title :" + dr["bookTitle"].ToString(); lblauthor.Text = "Author :" + dr["bookAuthor"].ToString(); lblisbn.Text= "ISBN :" + dr["bookISBN"].ToString(); lblpubliser.Text= "Publiser :" + dr["bookPublisher"].ToString(); lblyearpublished.Text= "Year Published :" + dr["bookYearPublished"].ToString(); lbldatereceived.Text= "Date Received :" + dr["bookDateReceived"].ToString(); lblcategory.Text= "Category :" + dr["bookCategory"].ToString(); lblloanstatus.Text= "Loan Status :" + dr["bookLoanStatus"].ToString(); ActiveForm = frmSearchResult; } catch(System.IndexOutOfRangeException) { lblError.Visible = true; }

Answers (4)