Click here to Skip to main content
15,886,851 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,


I have 2 text boxes and one button.When i enter value in textbox it should fetch the details from DB and store that row.Again when i search for a product the previous searched product should also be displayed (In Gridview).



How do i achieve this without creating a table in database ??
Posted
Comments
astika 4-Feb-14 6:36am    
what is your problem?explain in detail
Challa92 4-Feb-14 6:44am    
I need to save data without creating a Table in database!

Basically i need to search products quantity vise and store them at a place without manipulating the database.

the products searched should be displayed in gridview(i know how to display it though)
Problem is where to store them??


You could create a in-memory DataTable and bind the latter to the GridView.
 
Share this answer
 
Is this search just meant to be per-session, or must the same set of values be available for all users? If it's per-session, then just store the results in the Session. If it's meant to be for all users, store the results in the Cache.
 
Share this answer
 
CPallini's solution will work.

However, just in case you are talking about too many such records then may be you want to look at storing in an XML temporarily and keep displaying the data from this XML on the Datagrid.

What I mean is:
1. Fetch the search result first time from the DB and display. Also write it into the XML.
2. On the 2nd search event fetch the results from the DB, add it to the XML and then display from this XML.

Please note that this is only if there are many such operations on your site. Otherwise an in-memory data table is sufficient.
 
Share this answer
 
v2
Comments
Challa92 4-Feb-14 7:02am    
How do i retrieve data from database to xml??

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