?
Solved

Loading Datagridview via textbox with binding controls

Posted on 2010-11-23
9
Medium Priority
?
327 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month11 days, 9 hours left to enroll

752 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