HI
I have 2 DropDownList and 1 button in admin.aspx page
1=DDLtradeO and 2=DDLclassO
users should select Item from both of them I use RequiredFieldValidator for both of them and when they click on button in HOuse_info Table it insert their data
here when users select first item from DDLtradeO (that text is="State" )
{ DDLclassO.Enable=false}
below is code
<asp:DropDownList ID="DDLtradeO" runat="server" CssClass="DPCDDLs" AutoPostBack="true" OnSelectedIndexChanged="DDLtrade_SIC">
</asp:DropDownList>
and behind code
protected void DDLtrade_SIC(object sender, EventArgs e)
{
if (DDLtrade.SelectedItem.Text != "State")
{
BindTrade();
DDLclass.Enabled = true;
Rfv11.Visible = true;
}
else
{
DDLclass.Enabled = false;
Rfv11.Visible = false;
}
here RFV11 is RequiredFieldValidator for DDlclasso
problem is here when users select other item from DDltradeO and they select Item form DDLcalssO when they click on button it insert data into House_info table correctly
but when they select "STATE" Item from DDLtradO (they can't select Item from DDlcalssO) when they click button this error occure
Server Error in '/behtop website' Application.
String or binary data would be truncated.
The statement has been terminated.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: String or binary data would be truncated.
The statement has been terminated.
Source Error:
Line 312:
Line 313:
Line 314: int result = Convert.ToInt32(_cmd.ExecuteScalar()); Line 315: _cn.Close();
Line 316: //LBLERROR.Text = _cmd.Parameters["@Success"].Value.ToString();
|
I think its depend to RequiredFieldValidator but I want if users select other Item from DDltrade they select Item from DDLcalssO.
what should I do?
Thanks
Server Error in '/behtop website' Application.
String or binary data would be truncated.
The statement has been terminated.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: String or binary data would be truncated.
The statement has been terminated.
Source Error:
Line 312:
Line 313:
Line 314: int result = Convert.ToInt32(_cmd.ExecuteScalar()); Line 315: _cn.Close();
Line 316: //LBLERROR.Text = _cmd.Parameters["@Success"].Value.ToString();
|