From: Charles U. <cha...@ho...> - 2006-04-18 14:57:18
|
<html><div style='background-color:'><DIV class=RTE>Hello everyone!</DIV> <DIV class=RTE> </DIV> <DIV class=RTE>I'm using version 2 RC1 of the .NET FB Provider and VS 2005</DIV> <DIV class=RTE> </DIV> <DIV class=RTE>I'm trying to execute a procedure but i get an error. (please see below)</DIV> <DIV class=RTE> </DIV> <DIV class=RTE>my stored procedure need to return a parameter. I have taking off the return parameter from the stored procedure because I thoght that was the cause of the error but the problem is the same. </DIV> <DIV class=RTE> </DIV> <DIV class=RTE>Tia</DIV> <DIV class=RTE> </DIV> <DIV class=RTE>Charles</DIV> <DIV class=RTE> </DIV> <DIV class=RTE>--------------- Error -----------------------</DIV> <DIV class=RTE> <H2><I>Exception of type 'FirebirdSql.Data.Common.IscException' was thrown.</I> </H2><FONT face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "><B>Description: </B>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. <BR><BR><B>Exception Details: </B>FirebirdSql.Data.Common.IscException: Exception of type 'FirebirdSql.Data.Common.IscException' was thrown.<BR><BR><B>Source Error:</B> <BR><BR> <TABLE width="100%" bgColor=#ffffcc> <TBODY> <TR> <TD><CODE><PRE>Line 152: Line 153: // Execute Update <FONT color=red>Line 154: myCommand.ExecuteNonQuery(); </FONT>Line 155: Line 156: // Commit changes</PRE></CODE></TD></TR></TBODY></TABLE><BR><B><FONT face=Verdana>Source File: </FONT></B>c:\2005 Projects\Star Net Limo\StarsLimoWebSite\Reservations.aspx.cs<B><FONT face=Verdana> Line: </FONT></B>154 <BR><BR><B><FONT face=Verdana>Stack Trace:</FONT></B> <BR><BR> <TABLE width="100%" bgColor=#ffffcc> <TBODY> <TR> <TD><CODE><PRE>[IscException: Exception of type 'FirebirdSql.Data.Common.IscException' was thrown.] FirebirdSql.Data.Client.Gds.GdsConnection.ReadStatusVector() +866 FirebirdSql.Data.Client.Gds.GdsConnection.ReadResponse() +107 FirebirdSql.Data.Client.Gds.GdsDatabase.ReadResponse() +14 FirebirdSql.Data.Client.Gds.GdsStatement.Prepare(String commandText) +247 FirebirdSql.Data.FirebirdClient.FbCommand.Prepare(Boolean returnsSet) +309 FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteCommand(CommandBehavior behavior, Boolean returnsSet) +17 FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteNonQuery() +53 [FbException (0x80004005): Dynamic SQL Error parameter mismatch for procedure INSERT_RESERVATION] FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteNonQuery() +127 Reservations.ASPxButton4_Click(Object sender, EventArgs e) in c:\2005 Projects\Star Net Limo\StarsLimoWebSite\Reservations.aspx.cs:154 DevExpress.Web.ASPxDataControls.ASPxButton.OnClick(EventArgs e) +75 DevExpress.Web.ASPxDataControls.ASPxButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +284 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +172 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4920 </PRE></CODE></TD></TR></TBODY></TABLE><BR> <HR width="100%" color=silver SIZE=1> <B><FONT face=Verdana>Version Information:</FONT></B> Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42 </FONT><!-- [IscException]: Exception of type 'FirebirdSql.Data.Common.IscException' was thrown. at FirebirdSql.Data.Client.Gds.GdsConnection.ReadStatusVector() at FirebirdSql.Data.Client.Gds.GdsConnection.ReadResponse() at FirebirdSql.Data.Client.Gds.GdsDatabase.ReadResponse() at FirebirdSql.Data.Client.Gds.GdsStatement.Prepare(String commandText) at FirebirdSql.Data.FirebirdClient.FbCommand.Prepare(Boolean returnsSet) at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteCommand(CommandBehavior behavior, Boolean returnsSet) at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteNonQuery() [FbException]: Dynamic SQL Error parameter mismatch for procedure INSERT_RESERVATION at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteNonQuery() at Reservations.ASPxButton4_Click(Object sender, EventArgs e) in c:\2005 Projects\Star Net Limo\StarsLimoWebSite\Reservations.aspx.cs:line 154 at DevExpress.Web.ASPxDataControls.ASPxButton.OnClick(EventArgs e) at DevExpress.Web.ASPxDataControls.ASPxButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) [HttpUnhandledException]: Exception of type 'System.Web.HttpUnhandledException' was thrown. at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.reservations_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\starslimowebsite\65f21fa1\b9a34f6f\App_Web_u48lmxu4.0.cs:line 0 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) --></DIV> <DIV class=RTE>----------------------------------------------</DIV> <DIV class=RTE> </DIV> <DIV class=RTE>------------------------- My Code ------------------------</DIV> <DIV class=RTE><FONT color=#0000ff size=2> <P>protected</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>void</FONT><FONT size=2> ASPxButton4_Click(</FONT><FONT color=#0000ff size=2>object</FONT><FONT size=2> sender, </FONT><FONT color=#008080 size=2>EventArgs</FONT><FONT size=2> e)</P> <P>{</P> <P></FONT><FONT color=#0000ff size=2>string</FONT><FONT size=2> connectionString =</FONT><FONT color=#800000 size=2>"Database=C:\\2005 Projects\\Star Net Limo\\Database\\STARSNETLIMO.FDB;"</FONT><FONT size=2> + </FONT><FONT color=#800000 size=2>"User=SYSDBA;"</FONT><FONT size=2> + </FONT><FONT color=#800000 size=2>"Password=masterkey;"</FONT><FONT size=2> + </FONT><FONT color=#800000 size=2>"Dialect=3;"</FONT><FONT size=2> + </FONT><FONT color=#800000 size=2>"Server=localhost"</FONT><FONT size=2>;</FONT></P> <P><FONT color=#008080 size=2>FbTransaction</FONT><FONT size=2> myTransaction;</P> <P></FONT><FONT color=#008080 size=2>FbConnection</FONT><FONT size=2> myConnection = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#008080 size=2>FbConnection</FONT><FONT size=2>(connectionString);</P> <P>myConnection.Open();</P> <P>myTransaction = myConnection.BeginTransaction();</P> <P></FONT><FONT color=#008080 size=2>FbCommand</FONT><FONT size=2> myCommand = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#008080 size=2>FbCommand</FONT><FONT size=2>(</FONT><FONT color=#800000 size=2>"EXECUTE PROCEDURE INSERT_RESERVATION"</FONT><FONT size=2>, myConnection, myTransaction);</P> <P>myCommand.Parameters.Add(</FONT><FONT color=#800000 size=2>"@COMPANY_NAME"</FONT><FONT size=2>, </FONT><FONT color=#008080 size=2>FbDbType</FONT><FONT size=2>.VarChar, 100, </FONT><FONT color=#800000 size=2>"COMPANY_NAME"</FONT><FONT size=2>).Direction = </FONT><FONT color=#008080 size=2>ParameterDirection</FONT><FONT size=2>.Input;</P> <P>myCommand.Parameters.Add(</FONT><FONT color=#800000 size=2>"@PASSENGER_NAME"</FONT><FONT size=2>, </FONT><FONT color=#008080 size=2>FbDbType</FONT><FONT size=2>.VarChar, 100, </FONT><FONT color=#800000 size=2>"PASSENGER_NAME"</FONT><FONT size=2>).Direction = </FONT><FONT color=#008080 size=2>ParameterDirection</FONT><FONT size=2>.Input;</P> <P>myCommand.Parameters[0].Value = txCompanyName.Text;</P> <P>myCommand.Parameters[1].Value = txPassengerName.Text;</P> <P></FONT><FONT color=#008000 size=2>// Execute Update</P></FONT><FONT size=2> <P>myCommand.ExecuteNonQuery();</P> <P></FONT><FONT color=#008000 size=2>// Commit changes</P></FONT><FONT size=2> <P>myTransaction.Commit(); </P> <P></P> <P></FONT><FONT color=#008000 size=2>// Free command resources in Firebird Server</P></FONT><FONT size=2> <P>myCommand.Dispose();</P> <P></FONT><FONT color=#008000 size=2>// Close connection</P></FONT><FONT size=2> <P>myConnection.Close();</P> <P>}</P></FONT></DIV> <DIV class=RTE>---------------------------------------------------------------</DIV></div></html> |