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

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

695 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