In run mode as follows
Name textbox1
Designation Courseofficer (Dropdownlist)
Prinicpal
Director
Save(Buuton)
in the designation column three values are there in the dropdownlist
When user type the name ram in textbox1 and select the designation from the dropdownlist.
Suppose i am selecting the Courseofficer from the dropdownlist and click Save button records are saved.
but i am selecting the courseofficer from the dropdownlist only. But in database
last value Director is saved in the database.
Save button code as follows
Sql = "insert into Designations values('" + txt_name.Text + "','" + ddldesg.SelectedValue.ToString() + "')";
SCon.ExecSql(Sql);
LblErr.Text = "Record Inserted Successfully";
SCon.Con.Close();
In database records as follows
ID Name Designations
1 Ram Director
please help me what is the problem in my above code.
Name textbox1
Designation Courseofficer (Dropdownlist)
Prinicpal
Director
Save(Buuton)
in the designation column three values are there in the dropdownlist
When user type the name ram in textbox1 and select the designation from the dropdownlist.
Suppose i am selecting the Courseofficer from the dropdownlist and click Save button records are saved.
but i am selecting the courseofficer from the dropdownlist only. But in database
last value Director is saved in the database.
Save button code as follows
Sql = "insert into Designations values('" + txt_name.Text + "','" + ddldesg.SelectedValue.ToString() + "')";
SCon.ExecSql(Sql);
LblErr.Text = "Record Inserted Successfully";
SCon.Con.Close();
In database records as follows
ID Name Designations
1 Ram Director
please help me what is the problem in my above code.

Raja TRank #685 · 3.5K reputationPosted Aug 11, 2015, 8:06 PM EDT
Dipankar BiswasRank #992 · 2K reputationPosted Aug 11, 2015, 8:06 PM EDT
Rajeesh MenothRank #118 · 18.4K reputationPosted Aug 11, 2015, 8:16 PM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Aug 11, 2015, 10:05 PM EDT
Hello Try this code snipt-
{
}
RakeshRank #397 · 6.3K reputationPosted Aug 11, 2015, 10:31 PM EDT
Munesh SharmaRank #174 · 13.9K reputationPosted Aug 11, 2015, 10:45 PM EDT