473,461 Members | 1,313 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Finding records in a database

Ian
Hi everyone,

I have a (probably very simple) problem which is bugging me. I have
created a form which has several controls bound to a dataset. I would
like to implement a 'search' combobox; you select the appropriate
record in the combox and the form changes the data shown. I have
created the combobox abut cannot seem to be able to change the current
data shown on the form.
I have tried using dataviews:
Dim dv As New DataView(objdstContList.Tables("Table: Controller
List"))
dv.RowFilter = "ID = " & cbx.selectedvalue
dv.Sort = "ID"
I have also tried to select a record in the dataset itself:
' objdstContList.Tables("Table: Controller
List").Select("ID = " & cbx.selectedvalue)
And a few other variations. All the code seems to be working, just not
doing what I want!

Any help would be gratefully accepted.

Ian Gaskell

Nov 23 '05 #1
1 929
Ian,

Funny there was somebody in the adonet newsgroup with almost the same
question as you.

This was my answer.

Probably databinding will do the trick for you and than you are ready with
the in build functionality.

http://www.vb-tips.com/default.aspx?...f-587f730fa118

The sample is very simple just to see the approach.

If you by instance set the same datasource to a combobox and to a
datagridview, than the binding will forever select the same row.

Be aware that you use instead of the sample because of your sorting question
forever the datatable.defaultview or another from the datatable created new
dataview.

(I did not do this in this sample to keep it simple, probably I will change
this soon, because that I am writing this forever)

I hope this gives some idea's

Cor

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: andreas.maurer1971 | last post by:
Hi all, since a few years I use the following statement to find duplicate entries in a table: SELECT t1.id, t2.id,... FROM table AS t1 INNER JOIN table AS t2 ON t1.field = t2.field WHERE...
1
by: Jorge Godoy | last post by:
Hi. I have created an interface where I have a QDataBrowser and all of its editing and navigating controls and one of the displayed controls is in a QSpinBox. I have the navigation from...
2
by: Antitax | last post by:
I have a database with more than 800 adress records Some of the are similar because some letters in the street adress for example are not identical, altough they point to the same adress. Does...
5
by: Mike | last post by:
Hi I've written a module to find the first occurrence of a record in a query (that is my forms datasource) that matches four specified criteria. No matter what I try it doesn't seem to find ...
6
by: GSpiggle | last post by:
I have a database with records that should have a consecutive number ID (Check Register). Also has other records (deposits and adjusting entries) that don't fit in the number range so...
6
by: Maxi | last post by:
I have 100 tabes in an Access database, every table has 1 filed with 100 names (records), no primary key assigned. I would like to find duplicates. Here is the criteria: The computer should...
9
by: Friar Broccoli | last post by:
Hello world; I have two questions with respect to MSAccess database files (*.mdb and assorted helper files): 1) Is there documentation (presumably imperfect, achieved by reverse...
2
by: ElkGroveR | last post by:
Hi there! I'm using PHP to create a simple, dynamic MySQL SELECT query. The user chooses a selection from a HTML Form SELECT element's many options and submits the form via a POST action. ...
1
by: colinw | last post by:
I need to query a table of data that has multiple datetime entries in it relating to individual customer records. So one customer could have 1 entry, or it could have 10 entries. I need to be able to...
1
by: Deepmala26 | last post by:
Hi, I m doing a project in VB.NET. I've created form and database connectivity is done. I've displayed data in Datagrid through which user can sort and find records. for finding...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.