DataSet - Starting from scratch

G

Guest

I have created a data entry form that will allow the user to enter in new
data. The form has a binding navigator control, a binding source control,
four label controls, four text box controls and one command button.

The first objective I’m trying to accomplish is the scenario where the
dataset is empty, and I want to add new information to the dataset.

When I open the form the binding navigator control’s move first, move
previous, move next and move last buttons are disabled. Since the dataset is
empty this is an expected result. The only enabled buttons on the binding
navigator control are; Add New, Save to dataset and Update the database.

Now I am going to add a record. I type in the following record into the
following text boxes:
Binding ID - <blank>
Ordinal – 1
Code – TST1
Name – Record 1

I click on the save to dataset button on the binding navigator control and
the binding navigator position item on the navigator control says one, as
well as the binding navigator count item. In other words it says I have 1 of
1 record in the dataset.

At this time I expect the move first, move previous, move next and move last
buttons to be enabled. They still remain disabled.

Okay, maybe the navigation buttons need more than one record in the dataset.
So I add this one:
Binding ID - <blank>
Ordinal – 2
Code – TST2
Name – Record 2

I click on the save to dataset button and I now have 1 of 2 records and the
move next and move last buttons on the binding navigator control are enabled.
If I click on either the Move Last or Move Next button on the Move Previous
and Move Last buttons are enabled and the Move Next and Move Last Buttons are
disabled.

Okay, now I’m going to check to see if both the records are present in the
dataset. So I click on the Move Previous button and I get this:
Binding ID – 1
Ordinal – 2
Code - <blank>
Name - <blank>

If I press the move next button I get this:
Binding ID – 2
Ordinal – 2
Code – TST2
Name – Record 2

I should have both records in the dataset not just the last one. I also
think the move next and move last buttons should be enabled when I added the
first record into the dataset.

Does anyone know why this is happening?

Thanks,
 
G

gs

I am not sure if I followed the long thread correctly. I did not find
where you saved the 2nd record before scrolling.

another point, if there is no record preceding the current row, I would not
expect move previous, same with no next record, would I expect move next.
move last and first does not matter when you only one or zero record
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top