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
Jonny Bergstrom
NA
5
0
Get table data into a listview object
Jul 16 2008 6:23 AM
Hi
i want to get data from my access table and put in in a listview in my program.
I'm newbie in C#. Can anyone help me with this?
I have a metod called oppnaAdressBok.
here is the code:
void oppnaAdressBok(object sender, EventArgs ex)
{
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\..\\persondata.mdb";
OleDbConnection myConnection = new OleDbConnection(connectionString);
string query = "select * form data";
OleDbDataAdapter myAdapter = new OleDbDataAdapter(query, myConnection);
DataSet personData = new DataSet();
myAdapter.Fill(personData);
ListViewItem nyKontakt = new ListViewItem();
//Repetera för varje tabell
foreach (DataTable table in personData.Tables)
{
//repetera för varje row i tabellen
foreach (DataRow row in table.Rows)
{
// code here.
}
}
}
Reply
Answers (
5
)
Complex error sending HTML email by system.web.mail vb.net
Setup that updates it slf as a new setup is created