Server Error in '/BirdWeb' Application.

ERROR [07S01] [Microsoft][ODBC SQL Server Driver]Invalid use of default parameter

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.Odbc.OdbcException: ERROR [07S01] [Microsoft][ODBC SQL Server Driver]Invalid use of default parameter

Source Error:


Line 138:        myCommand.Parameters["@name"].Value = name;
Line 139:        myCommand.Connection.Open();
Line 140:        object res = myCommand.ExecuteScalar();//?.ToString();
Line 141:        string id = "";
Line 142:        if (res != null) {

Source File: d:\inetpub\vhosts\seattleaudubon.org\httpdocs\BirdWeb\components\BirdWebDB.ascx    Line: 140

Stack Trace:


[OdbcException (0x80131937): ERROR [07S01] [Microsoft][ODBC SQL Server Driver]Invalid use of default parameter]
   System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode) +1106946
   System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader, Object[] methodArguments, SQL_API odbcApiMethod) +1059
   System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader) +68
   System.Data.Odbc.OdbcCommand.ExecuteScalar() +92
   ASP.components_birdwebdb_ascx.GetIDFromName(String sql, String name) in d:\inetpub\vhosts\seattleaudubon.org\httpdocs\BirdWeb\components\BirdWebDB.ascx:140
   ASP.components_birdwebdb_ascx.FamilyIDFromName(String family_name) in d:\inetpub\vhosts\seattleaudubon.org\httpdocs\BirdWeb\components\BirdWebDB.ascx:186
   ASP.family_details_aspx.Page_Load(Object Source, EventArgs e) in d:\inetpub\vhosts\seattleaudubon.org\httpdocs\BirdWeb\family_details.aspx:16
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +52
   System.Web.UI.Control.OnLoad(EventArgs e) +97
   System.Web.UI.Control.LoadRecursive() +61
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4110.0