Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am having database with more than 30 tables and some table are having about 25000+ records with about 15+ columns....
I want to know which is fastest and efficient way to display records in gridview and i am also having a formview to display selected record in formview for update operation....
i have achieved this using sqldatasource....
but website is going to live in some days,someone told me to use dataset for this purpose since sqldatasource is a heavy control....
and i also want to perform Full text Search on displayed table or may i use LIKE clause...
but LIKE clause is somewhat like
SELECT * FROM STUDENT_TBL WHERE ((Name='%@Name%') OR (Address='%@Address%') OR .......)
Posted

You can use Rowfilters on your default dataview. Below is a simple example.


C#
dataTableConfig = _wrapper.GetMedcoProductConfig(); //this is the DB call to get your datatable
             DataView dvPDPD = dataTableConfig .Tables[0].DefaultView;
             dvPDPD.RowFilter = "RX_PDPD_ID = '" + txtSuggest.Text.Trim().ToUpper()+"'";
             gvConfig.DataSource = dvPDPD.ToTable();
             gvConfig.DataBind();
 
Share this answer
 
Comments
Guruprasad.K.Basavaraju 18-Apr-14 23:04pm    
Why was this answer down voted ??
USe Sql Data Source. It's the best we've got in ASP.NET.
 
Share this answer
 
Comments
Pawan Wagh 18-Apr-14 15:16pm    
Then how to perform this type of query using sqldatasource
SELECT * FROM STUDENT_TBL WHERE ((Name='%@Name%') OR (Address='%@Address%') OR .......)
USe FilterExpression="Name LIKE '{0}' AND Address LIKE '{1}'" here 0 and 1 are passed from FilterParameters element.

However i think use of SQLdatasource has some limitations and thus not very popular among developers, I think use client side control like JQGrid. Refer
Using JqGrid in ASP.NET[^]
 
Share this answer
 
Comments
Pawan Wagh 18-Apr-14 16:07pm    
But i prefer using serverside control....since not so good at client side scripting
Rishikesh_Singh 18-Apr-14 16:54pm    
I can assure you its not difficult and now as a ASP.Net developers we cannot ignore power of JS . Microsoft themselves have realized it and have started adding JQuery library as default in all the VS projects starting 2010. They themselves are moving away from these server side controls as is evident from their recent MCPD certifications.
Rishikesh_Singh 19-Apr-14 3:08am    
Seems like my somebody from this post has assumed that i have downvoted their post and has downvoted this and all other my earlier posts...
Can i do the same, its just a click away.. loser.

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