private void insertbtn_Click(object sender, EventArgs e)
{
string name = textBox1.Text.ToString();
string course;
for (int i = 0; i < checkedListBox1.CheckedItems.Count; i++)
{
course += checkedListBox1.CheckedItems[i].ToString() + " ";
}
string constring = "PROVIDER= MSDAORA;USER ID = SYSTEM; PASSWORD = mca";
string query = "insert into checkapp1 values('" + name + "','" + course+ "')";
cn = new OleDbConnection(constring);
cn.Open();
cm = new OleDbCommand(query, cn);
cm.ExecuteNonQuery();
MessageBox.Show("data inserted");
}
problem in inserting data by this code. showing a error"unassigned value 'course' is used". please verify and correct it. :(