hi guys,
i have start working with C#, i m making a simple application for my office, i m using mysql database. my question is i want to make a record navigation button like: Next, Previous ..... kindly guide me how to make this. i m using mysql database with mysqlconnector. i hope someone reply me correctly.
i have repeate my post with code this time.
*******************************************
private void btnNext_Click(object sender, EventArgs e)
{
string myConnection = "datasource=localhost;port=3306;username=root";
MySqlConnection myconn = new MySqlConnection(myConnection);
MySqlCommand com = new MySqlCommand("select count(id) from dbcj.kartype", myconn);
MySqlDataAdapter dataAdapter = new MySqlDataAdapter("SELECT type FROM dbcj.kartype", myconn);
DataSet dataSet = new DataSet();
dataAdapter.Fill(dataSet);
myconn.Open();
object count = com.ExecuteScalar();
int counter = Convert.ToInt32(count);
if (count != null)
{
int i = 1;
while (i > counter)
{
typeBox.Text = dataSet.Tables[0].Rows[i]["type"].ToString();
i++;
}
/*
foreach (string ii in counter.ToString())
{
typeBox.Text = dataSet.Tables[0].Rows[i]["type"].ToString();
}*/
}