private void load_cb()
{
myconnection.Open();
SqlCommand cmd = new SqlCommand("mp_statusopen", myconnection);
cmd.CommandType = CommandType.StoredProcedure;
DataTable dt_probdesc = new DataTable();
SqlDataAdapter adaptor = new SqlDataAdapter(cmd);
adaptor.Fill(dt_probdesc);
Desc_cb.DataSource = dt_probdesc;
Desc_cb.DisplayMember = "Description_id"; //"desc" is whatever the column in the server name is that you want displayed.
myconnection.Close();
}
private void Form1_Load(object sender, EventArgs e)
{
load_cb();
}
private void Submit_btn_Click(object sender, EventArgs e)
{
myconnection.Open();
SqlCommand Submit_btn = new SqlCommand("mp_submitbtn", myconnection);
Submit_btn.CommandType = CommandType.StoredProcedure;
Submit_btn.Parameters.AddWithValue("@Description", Desc_cb.Text);
Submit_btn.Parameters.AddWithValue("@Prob_id", Desc_cb.SelectedValue);
Submit_btn.Parameters.AddWithValue("@Call",Call_box.Text);
Submit_btn.Parameters.AddWithValue("@date", DateTime.Now.ToString());
Submit_btn.ExecuteNonQuery();
myconnection.Close();
}