Server Error in '/' Application.

Error converting data type nvarchar to bigint.

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.SqlClient.SqlException: Error converting data type nvarchar to bigint.

Source Error:


Line 99: 
Line 100:
Line 101:            adapter.Fill(toReturn);
Line 102:
Line 103:            return toReturn;

Source File: d:\Sites\knightestates\App_Code\DataManager\DataAccessMethods.cs    Line: 101

Stack Trace:


[SqlException (0x80131904): Error converting data type nvarchar to bigint.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +3335088
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +334
   System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +4679
   System.Data.SqlClient.SqlDataReader.TryHasMoreRows(Boolean& moreRows) +255
   System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more) +298
   System.Data.SqlClient.SqlDataReader.Read() +43
   System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping) +166
   System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue) +219
   System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) +420
   System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +251
   System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +465
   System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +147
   DataAccessMethods.GetDataTableUsingQuery() in d:\Sites\knightestates\App_Code\DataManager\DataAccessMethods.cs:101

[Exception: SELECT IIF(ISNULL(rpl.RentalM2,0) = 1, 'per m2', 'pm') AS RentalM2Data, IIF(ISNULL(l.isPerWeek,0) = 1 OR ISNULL(rpl.HRWeeklyRates,0) = 1, 'per week', 'per night') AS RentalType, rpl.Overlays AS ListingStatus, l.PropertyStyle, (SELECT TOP 1 rlp.[Image] FROM RentalsListingPhoto rlp WHERE rlp.ListingId = rpl.PKInsertID) AS ListingPhoto, rpl.*, l.LandExtentType FROM RentalsPropertyListings rpl LEFT JOIN FINTrac.dbo.Listing l ON l.Id = rpl.InternetReference WHERE rpl.SAH4SAgencyID = @AgencyId AND rpl.InternetReference = @PropertyReference | Exception: Error converting data type nvarchar to bigint.]
   DataAccessMethods.GetDataTableUsingQuery() in d:\Sites\knightestates\App_Code\DataManager\DataAccessMethods.cs:107
   clsListing.singleRent_stringValue(String PropertyReference) in d:\Sites\knightestates\App_Code\clsListing.cs:331

[Exception: singleRent_stringValue | Exception: SELECT IIF(ISNULL(rpl.RentalM2,0) = 1, 'per m2', 'pm') AS RentalM2Data, IIF(ISNULL(l.isPerWeek,0) = 1 OR ISNULL(rpl.HRWeeklyRates,0) = 1, 'per week', 'per night') AS RentalType, rpl.Overlays AS ListingStatus, l.PropertyStyle, (SELECT TOP 1 rlp.[Image] FROM RentalsListingPhoto rlp WHERE rlp.ListingId = rpl.PKInsertID) AS ListingPhoto, rpl.*, l.LandExtentType FROM RentalsPropertyListings rpl LEFT JOIN FINTrac.dbo.Listing l ON l.Id = rpl.InternetReference WHERE rpl.SAH4SAgencyID = @AgencyId AND rpl.InternetReference = @PropertyReference | Exception: Error converting data type nvarchar to bigint.]
   clsListing.singleRent_stringValue(String PropertyReference) in d:\Sites\knightestates\App_Code\clsListing.cs:342
   rental.Page_Load(Object sender, EventArgs e) in d:\Sites\knightestates\rental_new.aspx.cs:89
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +90
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1533


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