Link to home
Start Free TrialLog in
Avatar of Fordraiders
FordraidersFlag for United States of America

asked on

Loading Datagridview via textbox with binding controls

vb.net 2008
sql server express 2005 backend
datagridview1
textbox =  fldCmfrnum


I have 2 situations.
I have a database table thats houses 3.4 mil + records

I DO NOT need the datagrid to load with all the data when the form opens or as you navigate through records.

I would like the datagridview1 to filter via a Textbox called   "txtCmfrnum"

as a person types in the textbox the datagridview1 filters to show the results...

tblXref_Bindingsource
is the control the datagridview is bound to...

Thanks
fordraiders



Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

I dont think its a good idea to filter along as the user types given the numnber of records. I would suggest to use a button to invoke the search once the search string has been entered.

Avatar of Fordraiders

ASKER

ok...would I have to refill the table adapter each time with the search criteria?
You would have to connect to database and load the results filtered by the criteria each time user presses a key, if you follow your idea. If you follow my idea, you would connect to the DB and get results every time user presses Load button.
code cruiser, I'm in the "Search Criteria Builder" after placing my dataset on the form...
trying to create a parameterized query to do a  "start with" wildcard search.

from this reference:
http://msdn.microsoft.com/en-US/library/hbsty6z7(v=VS.80).aspx


This will but need: a wild card syntax for "Starts With" search
SELECT MFRNUM, MFRNAME, WWGMFRNUM, WWGMFRNAME, WWGDESC, ITEM, COMMENTS, REDBOOKNUM, XREF, SPIN, RICHTEXT FROM dbo.SapData
WHERE MFRNUM = ?

SELECT MFRNUM, MFRNAME, WWGMFRNUM, WWGMFRNAME, WWGDESC, ITEM, COMMENTS, REDBOOKNUM, XREF, SPIN, RICHTEXT FROM dbo.SapData
WHERE MFRNUM = '? & *'
but will not work  !


Thanks'
fordraiders



WHERE MFRNUM Like '5%'

What is the type of MFRNum?
text
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thaanks
Glad to help :-)