Solved

Loading Datagridview via textbox with binding controls

Posted on 2010-11-23
9
320 Views
Last Modified: 2012-05-10
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



0
Comment
Question by:fordraiders
  • 5
  • 4
9 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 34199661
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.

0
 
LVL 3

Author Comment

by:fordraiders
ID: 34200178
ok...would I have to refill the table adapter each time with the search criteria?
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 34203450
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.
0
 
LVL 3

Author Comment

by:fordraiders
ID: 34206735
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



0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 83

Expert Comment

by:CodeCruiser
ID: 34206837
WHERE MFRNUM Like '5%'

What is the type of MFRNum?
0
 
LVL 3

Author Comment

by:fordraiders
ID: 34208175
text
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 34208194
Yeah then above syntax should work. Have you tried it?

For ends with

Where MFRNum Like '%N'

For anywere

Where MFRNum Like '%N%'

If you need to supply the value, from a textbox for example, then

Where MFRNum Like '" & txtFilter.Text & "%'"
0
 
LVL 3

Author Closing Comment

by:fordraiders
ID: 34215563
Thaanks
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 34216354
Glad to help :-)
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now