Click here to Skip to main content
16,020,840 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Error: Object reference not set to an instance of an object.
Error on the second line of code!! below
VB
Dim Rcount As Integer
        Rcount = dsCompanies.Tables("tbl_permits").Rows.Count
        txtRecordCount.Text = FormatNumber(Rcount.ToString, 0)


Thanks in advance!
Posted

1 solution

Best guess? Does your DataSet contain a Table called "tbl_permits"? Or did you spell it wrong?
Alternatively, have you got a DataSet in dsCompanies?

Put a breakpoint on the line and check.

Mind you, I suspect that code isn't real: The ToString should probably be a method call:
txtRecordCount.Text = FormatNumber(Rcount.ToString(), 0)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900