Hi Guys

I have asp.net application there i have a dropdownlist , even if i select any item from that list
when going to debug mode i always get the first list item number and index but interface shows the selected item on it , what is the reason for it any idea ?

 SqlCommand cmd = new SqlCommand("update ClassSchedule set CourseID=@CourseID,[Day]=@Day,StartTime=@StartTime,EndTime=@EndTime,ClassSerNo=@ClassSerNo,InsSerNo=@InsSerNo where Schedule_id=@SchID", con);
                cmd.Parameters.AddWithValue("@SchID", txtschid.Text);
                cmd.Parameters.AddWithValue("@CourseID", txtcourseid.Text);
                cmd.Parameters.AddWithValue("@Day", cbodayname.SelectedItem.Text);
                cmd.Parameters.AddWithValue("@StartTime", txtstarttime.Text);
                cmd.Parameters.AddWithValue("@EndTime", txtendtime.Text);
                cmd.Parameters.AddWithValue("@ClassSerNo", txtclassserno.Text);
                cmd.Parameters.AddWithValue("@InsSerNo", DBC.InstID);
                try
                {
                    con.Open();
                    cmd.ExecuteNonQuery();
                }

f86e33552044747e502a612a6d305004
thanks
regards
sumith

Attachments snap.JPG 128.98 KB snap.JPG 128.98 KB

Hi Fenrir

It is already addded,

thanks
regards
sumith

 if (!IsPostBack)
            {
                ListItem sun = new ListItem("SUNDAY", "1");
                ListItem mon = new ListItem("MONDAY", "2");
                ListItem tue = new ListItem("TUESDAY", "3");
                ListItem wed = new ListItem("WEDNESDAY", "4");
                ListItem thu = new ListItem("THURSDAY", "5");
                ListItem fri = new ListItem("FRIDAY", "6");
                ListItem sat = new ListItem("SATURDAY", "7");


                cbodayname.Items.Add(sun);
                cbodayname.Items.Add(mon);
                cbodayname.Items.Add(tue);
                cbodayname.Items.Add(wed);
                cbodayname.Items.Add(thu);
                cbodayname.Items.Add(fri);
                cbodayname.Items.Add(sat);
                }

Here are screen shot attached i have coded same problem but it is working fine

Edited 2 Years Ago by wasimmalik: File was missing

Attachments 1.jpg 13.93 KB 2.jpg 300.56 KB
This article has been dead for over six months. Start a new discussion instead.