WSDeveloper
New member
- Joined
- Apr 17, 2018
- Messages
- 2
- Programming Experience
- Beginner
please see the picture, I want to show records in listview as they are saved in table.
but with below code it is reading group ids only and showing this in a single line.
C#:
SqlDataAdapter dataAdap = new SqlDataAdapter(sqlcmd);
DataTable data = new DataTable();
dataAdap.Fill(data);
if (data.Rows.Count > 0)
{
//---------------------------------
foreach (DataRow row in data.Rows)
{
ListViewItem item = new ListViewItem(row[0].ToString());
for (int i = 1; i < data.Columns.Count; i++)
{
item.SubItems.Add(row[i].ToString());
// item.Text = row[i].ToString();
}
listView1.Items.Add(item);
}
//------------------------