Solved

Loading Datagridview via textbox with binding controls

Posted on 2010-11-23
9
321 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

920 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

14 Experts available now in Live!

Get 1:1 Help Now