Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a windows form that access a database

I am able to get the first and last records

but i want to get the next and previous records

 

i tried

Me.BindingContext(Me.DataSet81.Distribution_List.IDColumn, "ID").Position += 1

and

Me.BindingContext(Me.DataSet81.Distribution_List.IDColumn, "ID").Position -= 1

 

but i get an error

 

An unhandled exception of type 'System.ArgumentException' occurred in system.windows.forms.dll

 

Additional information: Can't create a child list for field ID.

 

is there a way to do it?

Posted

Yes I even went to the database copy the column header and paste it right into the code

but i did a work around its not the right way of doing it but it works

what i did was i got the id into a textbox and wrote out a new code

 

Dim num = TextBox7.Text

If num = "" Then

MsgBox("error no number")

first()

MsgBox("Have Re-loaded from begining")

 

Else

DataSet61.Clear()

 

OleDbDataAdapter6.SelectCommand.Parameters("ID").Value = num - 1

OleDbDataAdapter6.SelectCommand.Connection.Open()

Try

OleDbDataAdapter6.SelectCommand.ExecuteNonQuery()

OleDbDataAdapter6.Fill(DataSet61)

Catch ex As Exception

MsgBox(ex.Message)

End Try

OleDbDataAdapter6.SelectCommand.Connection.Close()

 

but it should have worked normally it kinda worked with a dataview but it only showed one record all the time

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...