I'm going to quit. Attempted plenty of stuff for five hrs straight. There is nothing visiting me.

I've got a C# application that may add records, remove records from the database. Additionally, it may show products in textboxes and that i can navigate the products utilizing a next and former button. For example below for the following button,

    private void btnNext_Click(object sender, EventArgs e)
    {
        if (inc != MaxRows - 1)
        {
            inc++;
            NavigateRecords();
        }
        else
        {
            MessageBox.Show("You have reached the end of available items", "End of Available Items", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
    }

MaxRows is

MaxRows = ds1.Tables["Laptops"].Rows.Count;

The technique I known as above is NavigateRecords which code is here now

private void NavigateRecords()
    {
        DataRow dRow = ds1.Tables["Laptops"].Rows[inc];

        txtMaker.Text = ds1.Tables["Laptops"].Rows[inc].ItemArray.GetValue(1).ToString();
        txtModel.Text = ds1.Tables["Laptops"].Rows[inc].ItemArray.GetValue(2).ToString();
        txtPrice.Text = ds1.Tables["Laptops"].Rows[inc].ItemArray.GetValue(3).ToString();
        txtBids.Text = ds1.Tables["Laptops"].Rows[inc].ItemArray.GetValue(4).ToString();
        txtScreen.Text = ds1.Tables["Laptops"].Rows[inc].ItemArray.GetValue(5).ToString();
        txtCPU.Text = ds1.Tables["Laptops"].Rows[inc].ItemArray.GetValue(6).ToString();
        txtMemory.Text = ds1.Tables["Laptops"].Rows[inc].ItemArray.GetValue(7).ToString();
        txtHD.Text = ds1.Tables["Laptops"].Rows[inc].ItemArray.GetValue(8).ToString();
        picLaptops.Image = Image.FromFile(ds1.Tables["Laptops"].Rows[inc].ItemArray.GetValue(9).ToString());
    }

I've an AutoNumber ID area during my Access database the user should have the ability to skip to (simply by entering the ID right into a textbox) and show the right record in various textboxes (make reference to NavigateRecords)

My issue is, how do you even do that? I want the right row to become displayed within the textboxes from NavigateRecords which will also update the "corporation" variable that's set globally to . eg, when the user begins this program and skips to express id 7, it'll display that record however when it will this the corporation also needs to update using the row number to ensure that basically clicked on next it will require me to id 8 and never id 2... in the event that is sensible. I've this to date.

private void btnSkip_Click(object sender, EventArgs e)
    {
        string searchFor = txtSkip.Text;
        DataRow[] Skip;
        int results = 0;

        Skip = ds1.Tables["Laptops"].Select("ID='" + searchFor + "'");

        results = Skip.Length;

        if (results > 0)
        {
            DataRow dr1;

            for (int i = 0; i < MaxRows; i++)
            {
                // who knows what to do here.... or getting every row is even the right thing to do...

            }

        }
        else
        {
            MessageBox.Show("No item found");
        }
    }

Modifying your next code sample:

private void btnSkip_Click(object sender, EventArgs e)
{
    string searchFor = txtSkip.Text;
    DataRow[] target = ds1.Tables["Laptops"].Select("ID='" + searchFor + "'");
    // I suspect that this should really not be a string, so ("ID=" + searchFor);

    if (target.Count() == 1) {
        inc = ds1.Tables["Laptops"].Rows.IndexOf(target[0]);
        NavigateRecords();
    } else { //there can be no more than one row, so this means no matches
        MessageBox.Show("No item found");
    }
}

...this really is presuming that ID is really a unique identifier inside the table.

Searching using your code a little, appears in my experience like perhaps you should be calling NavigateRecords() in your for loop.

Also, in case your just engaging in UI development you might want to take consider the MVVM design pattern particularly if your dealing with WPF. In case your dealing with WinForms or something like that else then possibly the MVP pattern might be worth searching at. In either case these designs assistance to separate the presentation in the application logic and could simplify issues such as this.