I have a RadioButtonList on that their is two option CD and DVD. In My Category table their is two Column CatId and CategoryName, CD and DVD is their, in CategoryName with its Id.Now while selecting one from the RadioButtonList, I want to save its Id in another table with some other value for that, what should I do please provide any suggestion better if I will get code. Thanks
I am using VS2005 and SQL 2005 its in webform
My Code is like this
ConnectionStr();
con.Open();
SqlCommand cmd=new SqlCommand("Insert into CDcutDetails(Catid,PId,Date,DepName,Available_Qty,Alloted_To,CDCutBy,Remarks) Values('" + RadioBtnList_CD_DVD.SelectedItem+ "','" + ddlProductName.SelectedValue + "','" + tboxDate.Text.Trim() + "','" + ddlDepName.SelectedValue + "','" + tboxAllotQty.Text.Trim() + "','" + ddlAllotedTo.SelectedValue + "','" + ddlCD_CutBy.SelectedIndex + "','" + tboxRemark.Text.Trim() + "')", con);
cmd.ExecuteNonQuery();
LblMsg.Text = "Records Saved Successfully";
con.Close();