Skip to content

Blob

Hrvoje

Asked Oct 30, 2009, 12:48 AM EDT1 answer
Share
LinkedInX
I get a list of blobs from database to dataset.
I would like to put them into listview as small icons.
How to do that?

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Hai here is a sample code to show the dataset values in list view....

    // Load Data from the DataSet into the ListView
    private void LoadList()
    {
        // Get the table from the data set
        DataTable dtable = _DataSet.Tables["Titles"];

        // Clear the ListView control
        listView1.Items.Clear();

        // Display items in the ListView control
        for (int i = 0; i < dtable.Rows.Count; i++)
        {
            DataRow drow = dtable.Rows[i];

            // Only row that have not been deleted
            if (drow.RowState != DataRowState.Deleted)
            {
                // Define the list items
                ListViewItem lvi = new ListViewItem(drow["title"].ToString());
                lvi.SubItems.Add (drow["title_id"].ToString());
                lvi.SubItems.Add (drow["price"].ToString());
                lvi.SubItems.Add (drow["pubdate"].ToString());

                // Add the list items to the ListView
                listView1.Items.Add(lvi);
            }
        }
    }


    Here replace with ur table name and fields respectively...

    Hope this helps....

    If Someway my answer helped u don't forget to mark it as correct answer....
    0