| | |
Object reference not set to an instance of an object.
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Apr 2008
Posts: 114
Reputation:
Solved Threads: 6
Hi
I have a dataset which is popultaed with data from a text file, which in turn then populates a datagrid. This all works fine.
What im trying to do is search within the dataset based on a value input into a text box.
But everytime i do the search i keep gettign the error:
Object reference not set to an instance of an object.
The code i am using for the search is this:
I ust cant see what the problem is?
MAny thanks
I have a dataset which is popultaed with data from a text file, which in turn then populates a datagrid. This all works fine.
What im trying to do is search within the dataset based on a value input into a text box.
But everytime i do the search i keep gettign the error:
Object reference not set to an instance of an object.
The code i am using for the search is this:
VB.NET Syntax (Toggle Plain Text)
Dim re As String Dim s As String Dim i As Integer Dim TotalRows As Integer TotalRows = dt.Rows.Count s = LCase(txtSearch.Text) lstResults.Items.Clear() For i = 1 To TotalRows re = ds.Tables("CdrData").Rows(i).Item(5) If InStr(LCase(re), s) Then lstResults.Items.Add(ds.Tables("CdrData").Rows(i).Item(1)) End If Next
I ust cant see what the problem is?
MAny thanks
![]() |
Similar Threads
- Object reference not set to an instance of an object (ASP.NET)
- How to set attribute to the controls in datagrid? (ASP.NET)
- sql data pull with no result gives Object reference not set exception (VB.NET)
Other Threads in the VB.NET Forum
- Previous Thread: watch certain files within certain folder
- Next Thread: read/write files using visual studio 2009
| Thread Tools | Search this Thread |
.net .net2008 30minutes 2005 2008 access account arithmetic array basic bing button buttons center check code combobox component connectionstring crystalreport data database databasesearch datagrid datagridview date design dissertation dissertations dropdownlist excel fade file-dialog filter folder ftp generatetags google gridview hardcopy images input insert intel internet mobile monitor ms net networking objects output panel passingparameters peertopeervideostreaming picturebox picturebox1 port position print printing problem problemwithinstallation project save searchbox searchvb.net select serial shutdown soap survey table tcp temperature text textbox timer timespan toolbox trim update updown user vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf year





