Not sure why you are concatenating a value on your query while you have specified a parameter on it. Try replacing the code of your
OleDbCommand
to this.
OleDbCommand cmd3 = new OleDbCommand("SELECT d1 FROM VIPUL_DATE WHERE dw=@p1", con);
Also, this (
op.Value = DDLWEEK7.SelectedItem.ToString();
) will only return the type of the selected item, which is ListItem, and not the value. Im not sure about your purpose of using this. Try using
DDLWEEK7.SelectedValue
instead. Or if you want the index of the selected item, use
DDLWEEK7.SelectedIndex
property. Refer
here[
^] for more details about the DropDownList class.