I'm having difficulty understanding DataSets. I created a DataSet within a private void caled Form1_Load

private void Form1_Load(object sender, EventArgs e) {

     DataSet fooBar = new DataSet();
     adapter.Fill(fooBar, "value_" + x);              
     DataRow dRow = fooBar.Tables["ShiftLat_" + x].Rows[0];
     
}

How can I call this data from another private void within the form?

For instance when a listBox item is selected the coresponding value us pulled from the dataSet and displayed in the text of a textBox.

private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            shiftLatForm.Text = //cannot figure out what code to use here
        }

Perhaps a look at this thread could help you out.

commented: Nice thread :=) +11
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.