Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB.NET
|
VB.NET General VB.NET discussions for issues that don't fall into other VB.NET forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 17th, 2005, 02:33 PM
Registered User
 
Join Date: Jul 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Load a data form with a specific searched record

Hi everyone,

On a "Data Form" in a VB.Net Windows app, I'm trying to implement a search function where by entering a string (PK, ID) in the respective textbox and pressing a button, I want to move within the Dataset and display the record where the ID is the entered number (when available).
No matter what I do, I seem to be confronted with the problem of "Item is Read Only".

Example (this does not work, it's just to illustrate what I'm trying to do):

Me.BindingContext(objds.Tables(0).Rows(0), "TheTable") = Me.BindingContext(objds.TheTable.Rows.Find(TheID))


Note that I don't want to use a WHERE clause in the select command, I just want to "move" within the Dataset and have all the records available.

Thanks in advance

 
Old October 9th, 2005, 05:38 AM
Registered User
 
Join Date: Oct 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to frosties777
Default

y not use a for loor to loop throught the rows and if the row ID matches the id entered, the retrieve the data u wanted
example
With objds.Tables(0)
            id = textbox.text
            For i = 0 To .Rows.Count - 1
                'assign each row item to each variable
                If .Rows(i).Item("IC").ToString.Trim.Equals(id) Then
                .....
                ......,get the data u wanted
                End If
            Next
End with







Similar Threads
Thread Thread Starter Forum Replies Last Post
Search specific data from specific columns yogeshyl SQL Language 1 January 16th, 2008 11:12 AM
Copy specific data in specific cells of sheet2 yogeshyl Excel VBA 1 May 14th, 2007 07:40 AM
Need to dup a whole record in a data entry form markw707 Access 4 August 29th, 2005 10:09 AM
how to load specific value from dropdown list? method ASP.NET 1.0 and 1.1 Basics 1 June 17th, 2005 08:08 AM
New Record Data entry one form lgpatterson Classic ASP Basics 1 February 8th, 2005 12:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.