Solved

Loading Datagridview via textbox with binding controls

Posted on 2010-11-23
9
325 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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
 
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

705 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