指定的参数已超出有效值的范围 怎么解决 在线
“/qyml”应用程序中的服务器错误。
--------------------------------------
指定的参数已超出有效值的范围。参数名: 房地产业
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.ArgumentOutOfRangeException: 指定的参数已超出有效值的范围。参数名: 房地产业
源错误:
行 85: txt_MlbigClassName.SelectedValue = dtr( "MlbigClassName ").ToString
错误是着样的
代码
If Not IsPostBack Then
Dim myconn As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings( "connectionString "))
Dim dtr As SqlDataReader
Dim my_user = DecodeDES(Convert.ToString(Request.QueryString( "user ")), myKey, myIV)
Dim cmd As SqlCommand = New SqlCommand( "select Companydd,Companydjg,MlbigClassName,Companylx,clr,cln,cly,Companyfr,Companyzc,Companyrs,Companyms,zichan,Companyfw,fuzai,Companygm,Companyyye,Companykz,Companymj,Companyyy,Companysw,Companykhyh,Companyyhzh,Companyzy,Companyjy from CompanyContent where user_id= ' " & my_user & " ' ", myconn)
cmd.Parameters.Add( "@user_id ", Trim(my_user))
myconn.Open()
dtr = cmd.ExecuteReader()
While dtr.Read()
txt_Companydd.SelectedValue = dtr( "Companydd ").ToString
txt_Companydjg.SelectedValue = dtr( "Companydjg ").ToString
txt_Companylx.SelectedValue = dtr( "Companylx ").ToString
'txt_MlbigClassName.SelectedValue = dtr( "MlbigClassName ").ToString
clr.SelectedValue = dtr( "clr ").ToString
cly.SelectedValue = dtr( "cly ").ToString
cln.Text = dtr( "cln ").ToString
txt_Companyfr.Text = dtr( "Companyfr ").ToString
txt_Companyzc.Text = dtr( "Companyzc ").ToString
txt_Companyrs.Text = dtr( "Companyrs ").ToString
txt_Companyms.Text = dtr( "Companyms ").ToString
zichan.Text = dtr( "zichan ").ToString
txt_Companyfw.Text = dtr( "Companyfw ").ToString
fuzai.Text = dtr( "fuzai ").ToString
txt_Companygm.Text = dtr( "Companygm ").ToString
txt_Companyyye.Text = dtr( "Companyyye ").ToString
txt_Companykz.Text = dtr( "Companykz ").ToString
txt_Companymj.Text = dtr( "Companymj ").ToString
txt_Companyyy.Text = dtr( "Companyyy ").ToString
txt_Companysw.Text = dtr( "Companysw ").ToString
txt_Companykhyh.Text = dtr( "Companykhyh ").ToString
txt_Companyyhzh.Text = dtr( "Companyyhzh ").ToString
txt_Companyzy.Text = dtr( "Companyzy ").ToString
txt_Companyjy.Text = dtr( "Companyjy ").ToString
End While
dtr.Close()
myconn.Close()
End If
这个问题怎么解决?
[解决办法]
占上先
[解决办法]
txt_MlbigClassName是个什么控件? DropDownList?