locked
Migrating project from NetFramewok 2 to NetFramework 4.5 RRS feed

  • Question

  • User-1298974666 posted

    Hi ,

    I am working on an website developed in Asp.net.

    The initial framework was  NetFramework 1.4  and I migrated it to NetFramewok 2 on a Windows XP  local computer.

    But now i have to migrate it to NetFramework 3.5 or even a higher version so that i can run it in VS 2012 and Windows8.

    I configured the project on the new Windows 8 machine but I am having some issues with my .dll that i am using.

    I installed all of them in GAC , added as reference to the solution  but it seems that there is an issue with these dll  as in one of them i have the connections to the database and i get an sql connection error.

    I can execute query to the database from the cuurent project so it seems that there is no problem of access , but  aproblem with that .dll where i have all the database job.

    I don t have access to that dll so i am not sure what is wrong.

    Is there any part of configuration that i am missing for the Windows 8 machine?

    Wednesday, October 30, 2013 9:40 AM

Answers

  • User753101303 posted

    So this is a message that comes from the db side. Something is wrong with your SQL statement. As noted by the message you try to use a string value as if it were a numeric value and it fails as the conversion doesn't work :

    SELECT '1'+CAST(1 AS BIGINT)
    SELECT 'A'+CAST(1 AS BIGINT)

    Line #1 works. Line #2 fails with the same message.

    Double check your SQL statement and in particular everywhere you compare or compute something with columns that are not of the same type (or at least mixing string and numeric values).

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 30, 2013 11:38 AM

All replies

  • User753101303 posted

    Hi,

    Currently we just know that you have a "connection error" and have to guess about both what caused this but even what is exactly the error you have (is the old server name included in your connection string ? Is SQL Server installed/configured properly ?)

    So please ALWAYS post any error message you have wihtout waiting for someone to ask. Most often it greatly helps to narrow down the problem.

    Wednesday, October 30, 2013 9:59 AM
  • User-1298974666 posted

    Indeed i was not clear.

    There is nothing changed about the server as I am just trying to run the project in windows 8 + VS 2012.

    Currently i have it running on Windows XP + VS 2003 (IIS6) .

    So i just have to configure it locally.

    Here is the stack trace :

    {AGInteractive.Business.BillingException: System.Data.SqlClient.SqlException: Error converting data type varchar to bigint.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
       at System.Data.SqlClient.SqlDataReader.get_MetaData()
       at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
       at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
       at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
       at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
       at KMobile.BasicTools.SqlHelper.ExecuteReader(SqlConnection connection, CommandType cmdType, CommandBehavior cmdBehavior, String cmdText, SqlParameter[] parameters)
       at KMobile.BasicTools.SqlHelper.ExecuteReader(String connectionString, CommandType cmdType, String cmdText, SqlParameter[] parameters)
       at KMobile.BasicTools.SqlHelper.ExecuteReader(String connectionString, String spName, SqlParameter parameter)
       at AGInteractive.Business.Operator.Initialize(String ip) ---> System.Data.SqlClient.SqlException: Error converting data type varchar to bigint.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
       at System.Data.SqlClient.SqlDataReader.get_MetaData()
       at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
       at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
       at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
       at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
       at KMobile.BasicTools.SqlHelper.ExecuteReader(SqlConnection connection, CommandType cmdType, CommandBehavior cmdBehavior, String cmdText, SqlParameter[] parameters)
       at KMobile.BasicTools.SqlHelper.ExecuteReader(String connectionString, CommandType cmdType, String cmdText, SqlParameter[] parameters)
       at KMobile.BasicTools.SqlHelper.ExecuteReader(String connectionString, String spName, SqlParameter parameter)
       at AGInteractive.Business.Operator.Initialize(String ip)
       --- End of inner exception stack trace ---
       at AGInteractive.Business.Operator.Initialize(String ip)
       at AGInteractive.Business.Operator..ctor(String ip)
       at AGInteractive.Business.Customer..ctor(HttpRequest request)
       at xhtml_v7._default.Page_Load(Object sender, EventArgs e) in c:\Users\Adrian\Documents\Visual Studio 2012\Projects\xhtml_v7\default.aspx.cs:line 116}

    AGInteractiveBusiness and KmobileBasicTools are the dll which are referenced in my solution.

    In KMobileBasicTools I have the database work  and there seems to be the issue.

    Wednesday, October 30, 2013 11:07 AM
  • User753101303 posted

    So this is a message that comes from the db side. Something is wrong with your SQL statement. As noted by the message you try to use a string value as if it were a numeric value and it fails as the conversion doesn't work :

    SELECT '1'+CAST(1 AS BIGINT)
    SELECT 'A'+CAST(1 AS BIGINT)

    Line #1 works. Line #2 fails with the same message.

    Double check your SQL statement and in particular everywhere you compare or compute something with columns that are not of the same type (or at least mixing string and numeric values).

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 30, 2013 11:38 AM