Navigating dataset.tables.rows

Posted on 2004-09-27
Last Modified: 2008-01-09

Sir I want to work with VB.Net without using controls for sqlconnection, sqladapter and dataset.  So I created all this objects through coding. and it is working fine.
I am using bindingcontext class for movenext,movelast etc.  I did not use datagrid.  All controls are text boxes. during the form load records will be displayed in the screen. I want to find some records in the existing dataset.table(0) and display that record in the screen. I can find the record in dataset.  But cannot nvagate to that record to display instead first record displayed in the screen during the form load.  total row count is available, but current row number is not  getting.  If it is available I can say bm.position = row number(bm is instance of Class).

Please Help me, remember I am not using datagrid


Question by:adwat

Accepted Solution

KGreg earned 168 total points
ID: 12163871
You need to preload your dataset before you set the binding context..  try creating a procedure that fills it.. then set the binding context..

here is an example where I look for the 25th entry

    dim objDas as new DataSet

    Private Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.BindingContext(objdas, "myTable").Position = 25
    End Sub

I hope this helps you,

LVL 10

Assisted Solution

123654789987 earned 166 total points
ID: 12166823
look at the following link. It gives a clear description of using Binding context

Assisted Solution

wguerram earned 166 total points
ID: 12169629

'You have to specify the column where you will search the value.

dataset.Tables(0).DefaultView.Sort = "KeyColumn"

bm.Position = dataset.Tables(0).DefaultView.Find("ValueToSearch") 'Returns the row index

Featured Post

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Get size of each directory on each mapped drive 5 29
Assigning handler to UserControls in flowlayoutpanel 4 23
Crystal reports 2 41
Modal Popup Extender control 1 22
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

803 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