السلام عليكم ورحمة الله
تواجهني هذه المشكله عندما اختار قيمه معينه من comboBox تم ملأه من سيكوال داتابيز
ما عهدت اليه في هذا الكود هو انا اقوم بارسال القيمه الي property
ومن ثم ارساله الي بروسيدجر في سيكوال سيرفر داتا بيز
وهذا هو الكود
private void btnView_Click(object sender, EventArgs e)
{
Items itm = new Items();
itm.ExporterName = Convert.ToString(comboBox1.SelectedItem);
SqlConnection sqlcon;
SqlCommand command;
sqlcon = new SqlConnection("data source=.;database=cashier;integrated security=true;");
command = new SqlCommand("ViewStockByExporterName", sqlcon);
command.Parameters.AddWithValue("@ExporterName", itm.ExporterName);
sqlcon.Open();
SqlDataReader dr = command.ExecuteReader();
DataTable dt = new DataTable();
dt.Load(dr);
dataGridView1.DataSource = dt;
sqlcon.Close();
}