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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

record count

Status
Not open for further replies.

SlykFX

Programmer
Oct 12, 2002
76
GB
im not sure if this is the right place for this but ..

is there any reason as to why this isnt working?

Error:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:
Line 73:
Line 74: dt = ds.tables("--table_name--")
Line 75: i = dt.rows.count()
Line 76:
Line 77: pages = int(articles / 10) + 1
Source File: xxx\xxx.aspx Line: 75

Code:
       db is set to the location and name of the database in use for this page
		ds = new dataset
		dbadapter.fill(ds)

		dt = ds.tables("--table_name--")
		i = dt.rows.count
due to the nature of the code, i cant post much on here and also a few names have been edited slightly

everything is fine except for thelast line, if i comment "articles = dt.rows.count" then the rest of the page works fine, after crawling the net for the last hour and half i cant find anything wrong with it

I can't be bothered to have a sig!
 
ive fixed it, i just realised that i had missed the table name of the dataadapter.fill line

I can't be bothered to have a sig!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top