Displaying Search results

ntombisizulu

Member
Joined
Jun 1, 2005
Messages
12
Programming Experience
1-3
i have a search form in web application. based on the criteria selected for the search parameters are send to a stored procedure where the selection is done for the search criteria. my problem is returning the search results and the number of records selected on another page.

this is part of the code:
Try
IRSComm.ExecuteNonQuery()
'if the search is executed then the results that are obtained are displayed on the result.aspx page
Response.Redirect("results.aspx?result =")
Catch ex_sql As SqlException

Catch ex As Exception

please help me!!
 
ExecuteNonQuery does what the name suggests. If you are executing a stored procedure that returns a result set, that IS a query. You need to use ExecuteReader to create an SqlDataReader to read the result set line by line. Alternatively, you can use an SqlDataAdapter with your command assigned to its SelectCommand property and call Fill to get the result set directly into a table. Which method you use depends on your specific situation. Kulrom has provided a description of each and the differences in a previous post but I can't find it just now. I suggest you check the help for now and I'll try to find that post.
 

Latest posts

Back
Top