- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All Topicscan i use SQLCEDATA reader method to fill data in the list view?
can show me an sample code?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: rajaloysiousPosted on 2005-08-24 at 02:58:30ID: 14740936
yes u can do it
mbly.GetEx ecutingAss embly().Ge tName().Co deBase);
mat("DataS ource={0}\ \Northwind Demo.sdf", path));
nt; // Start timer
();
(r.GetName (i), -2, );
ew ListViewItem(columns));
;
nt - ticks;
, ticks);
some sample code from the net
cheers..
this.listView1.Clear();
this.textBox1.Text = "Testing listview...";
string path =
Path.GetDirectoryName(Asse
SqlCeConnection con = new
SqlCeConnection(String.For
con.Open();
SqlCeCommand cmd = con.CreateCommand();
cmd.CommandText = "Customers";
cmd.CommandType = CommandType.TableDirect;
int ticks = System.Environment.TickCou
SqlCeDataReader r = cmd.ExecuteReader(); // Get reader
this.listView1.BeginUpdate
for (int i = 0; i < r.FieldCount; i++ ) // Set up columns
{
this.listView1.Columns.Add
HorizontalAlignment.Center
}
string[] columns = new string[r.FieldCount];
while (r.Read())
{
for (int i = 0; i < r.FieldCount; i++ ) // Load data from the reader
{
columns[i] = r[i].ToString();
}
this.listView1.Items.Add(n
// And populate ListView with it.
}
this.listView1.EndUpdate()
ticks = System.Environment.TickCou
// Stop timer
r.Close();
cmd.Dispose();
con.Close();
this.textBox1.Text = String.Format("{0} rows in {1} ms",
this.listView1.Items.Count