private void Listview_Load(object sender, EventArgs e)
{
try
{
listView1.Items.Clear();
sqlcon.Open();
SqlCommand sqlcmd = new SqlCommand("select *from emp order by empcode asc", sqlcon);
//SqlDataReader dr = sqlcmd.ExecuteReader();
dr = sqlcmd.ExecuteReader();
while (dr.Read())
{
ListViewItem lv = new ListViewItem(dr["empcode"].ToString());
lv.SubItems.Add(dr["name"].ToString());
listView1.Items.Add(lv);
}
sqlcon.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
Application.ExitThread();
}
}
i have 4 buttons like first next last previous, i dont know how to write the code, i am new for c#..can anyone help me?