Hi,

I've found bug in ParameterName of FirebirdClient.

When you use it in ASP.NET with GridView & SqlDataSource it generates bad parammeter name.

TestCase:
1. add to the blank site SqlDataSource, configure it and GridView (and allow i.e. deleting button)
2. connect SqlDataSource with GridView
3. run the site and try to delete some row using the delete button (link)
        deleting will fail (exception stack is on bottom)
it's because the variable flowed through SqlData... is NOT i.e. @id but only id
        SqlData... & same GridView works with i.e. SQL Express server

The way how to solve this for this time is to add this workaround:

protected void SqlDataSource1_Deleting(object sender, SqlDataSourceCommandEventArgs e)
    {
        foreach (System.Data.Common.DbParameter p in e.Command.Parameters)
        {
            p.ParameterName = "@"+p.ParameterName;
        }
    }

If you want to ask something, don't hesitate to mail me.

Stack:
[FbException (0x80004005): Must declare the variable '@id']

FirebirdSql.Data.FirebirdClient.FbCommand.BuildNamedParametersDescriptor(Int16 count) +209

FirebirdSql.Data.FirebirdClient.FbCommand.BuildParametersDescriptor() +80
   FirebirdSql.Data.FirebirdClient.FbCommand.DescribeInput() +49

FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteCommand(CommandBehavior behavior, Boolean returnsSet) +253

FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteCommand(CommandBehavior behavior) +30
   FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteNonQuery() +191

System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation) +493

System.Web.UI.WebControls.SqlDataSourceView.ExecuteDelete(IDictionary keys, IDictionary oldValues) +923 System.Web.UI.DataSourceView.Delete(IDictionary keys, IDictionary oldValues, DataSourceViewOperationCallback callback) +176 System.Web.UI.WebControls.GridView.HandleDelete(GridViewRow row, Int32 rowIndex) +913 System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +1067 System.Web.UI.WebControls.GridView.RaisePostBackEvent(String eventArgument) +214

System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +31 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +32
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +244
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3838


--
Jiri Cincura
http://www.cincura.net/


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to