TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
vergel aranas
NA
70
17k
Hi Sir, i just want to ask and need some help on how can i display data from mysql to c# listview
Jul 1 2012 12:05 PM
Hi Sir, i just want to ask and need some help on how can i display data from mysql to c# listview. Here is my code but not working.
clientlistview.Items.Clear();
string sqlselect = "SELECT clientId, clientFName, clientMName, clientLName from clientreg";
MySqlConnection connect = new MySqlConnection(conn);
MySqlCommand cm = new MySqlCommand(sqlselect, connect);
DataTable tbl = new DataTable();
MySqlDataReader read = cm.ExecuteReader();
foreach (DataRow row in tbl.Rows)
{
ListViewItem list = new ListViewItem(row[0].ToString());
list.SubItems.Add(row[1].ToString());
list.SubItems.Add(row[2].ToString());
list.SubItems.Add(row[3].ToString());
clientlistview.Items.Add(list);
}
Thanks in advance Sir!
Reply
Answers (
3
)
Print Logo & data in Gridview in Windows Application
c# with MS Access