Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

Binding ListView to database

$
0
0

I have a problem with binding Listview to my database using entity framwork.
This code only shows the first row of the table but the records do not show:

var item = (from p in db.tbl_film
            select p).FirstOrDefault();
string[] items = {item.flm_id.ToString(),item.flm_name,item.flm_description,item.flm_category };
foreach (var itemlist in items)
{
    ListViewItem lvi = new ListViewItem(items);
    listView1.Items.Add(lvi);
}


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>