2012-04-24 6 views
0

私はuserloginIDのテキストボックスを持つログインパネルを持っています。ログインボタンがクリックされると、データソースはテキストボックス内のvalkueをピックアップし、userloginIDテキストボックスの値に応じてフィルタリングされたデータをchklistboxに提供します。chklistboxのデータソースのパラメータとしてテキストボックスの値を使用

ログインボタンをクリックしたときに私はchklistboxにデータソースを接続しますが、アプリはまだFAL;ウィットオーバーLS folowingメッセージ:ここ

The Type property of parameter 'UserLogin' cannot be set when the DbType property is set. 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.InvalidOperationException: The Type property of parameter 'UserLogin' cannot be set when the DbType property is set.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidOperationException: The Type property of parameter 'UserLogin' cannot be set when the DbType property is set.]
System.Web.UI.WebControls.Parameter.GetValue(Object value, Boolean ignoreNullableTypeChanges) +1751307
System.Web.UI.WebControls.ParameterCollection.GetValues(HttpContext context, Control control) +301
System.Web.UI.WebControls.SqlDataSourceView.InitializeParameters(DbCommand command, ParameterCollection parameters, IDictionary exclusionList) +264 System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +472
System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +95
System.Web.UI.WebControls.ListControl.PerformSelect() +34
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(EventArgs e) +22 System.Web.UI.WebControls.ListControl.OnPreRender(EventArgs e) +18 System.Web.UI.WebControls.CheckBoxList.OnPreRender(EventArgs e) +20 System.Web.UI.Control.PreRenderRecursiveInternal() +80
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842

は、ログインボタンのコードは、(onclickの)です。

Protected Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click 
    If btnLogin.Text = "Login" Then 
     btnLogin.Text = "Logout" 
     PanelLogin.BackColor = Drawing.Color.LightGreen 
     Me.CurrentUserLogin = Me.txtUserId.Text 
     Me.chkLstClientcodes.DataBind() 
     txtStatus.Text = "Logqed in as Andrew McLintock" 
     'LoginSuccessInit() 
     Me.chkLstClientcodes.DataSourceID = "clientcodes" 
    Else 
     btnLogin.Text = "Login" 
     PanelLogin.BackColor = Drawing.Color.LightSalmon 
     txtStatus.Text = "Not Logged In!!!" 
    End If 
    'Me.Page.Controls.Clear() 
End 

    Sub 

答えて

0

レポートのコンテキストで行が有効だった場合、フラグを立てたロジックを基本SQLに追加しました。条件付き書式設定がテストされ、色が変更されました。

関連する問題