views:

25

answers:

0

ok so here's my code

        int rowNo = 0;
        selected = listBox1.SelectedItem.ToString();
        sqlSelectCommand2.Parameters["@title"].Value = selected;
        sqlDataAdapter1.Fill(dataSet1);
        byte[] tempByteArray = (byte[])dataSet1.photos.Rows[rowNo]["photo"];
        MemoryStream pic = new MemoryStream(tempByteArray);
        Image photo1 = Image.FromStream(pic);
        utils.load(photo1, pictureBox2);
        dataSet1.Clear();

I'm trying to get the selected item from a listbox (which is linked to a dataset) to go to another listbox along with the picture thats stored with that title in the database.

Im getting the error message "no row at possition 0" but ive done the query

SELECT photo, title, photoid FROM photos WHERE (title = @title) on the dataAdapter

Please help im going out of my mind!!!