rangerstud620
Freshman
- Joined
- Jun 14, 2005
- Messages
- 27
I'm in the process of switching my apps from Access to SQL2000. Everything was working fine with Access but now as I'm making the switch to SQL, I'm having problems.
First, when I click an item in a ListBox, the selectedindex does not change, it stays at 1.
The following code in SelIndexChange always returns the value of 1, no matter which item in the list I select:
Second, when I pick an item from a dropdownlist, the item I select appears to be the actual selecteditem in the ddl, but when I try to update the db the value returned is the same as the original value in the db.
The following code always returns the original value in the database when I try to update the db.
It seems none of the selectedindexchanged events are being raised. I'm lost as to what is wrong now that I'm using SQL. Any ideas what I'm doing wrong?
First, when I click an item in a ListBox, the selectedindex does not change, it stays at 1.
Code:
<asp:listbox ID="ListBoxMaster" runat="server" AutoPostBack="true" Rows="22" Width="300" DataValueField="LEAD_ID" DataTextField="COMPANY" OnSelectedIndexChanged="SelIndexChange" />
Code:
Dim LeadID as integer = ListBoxMaster.SelectedItem.Value
Second, when I pick an item from a dropdownlist, the item I select appears to be the actual selecteditem in the ddl, but when I try to update the db the value returned is the same as the original value in the db.
Code:
<asp:dropdownlist ID="ddlSalesperson" runat="server" Enabled="false" Width="100" DataValueField="SALES_NUM" DataTextField="REVERSE_NAME" DataSource="<%# FillSales() %>" />
Code:
param = cmd.Parameters.Add("@Salesperson", SqlDbType.Char)
param.Value = DirectCast(di.FindControl("ddlSalesperson"), dropdownlist).SelectedValue
It seems none of the selectedindexchanged events are being raised. I'm lost as to what is wrong now that I'm using SQL. Any ideas what I'm doing wrong?
Last edited: