You must Sign In to post a response.
  • Category: ASP.NET

    Performance required to load data from excel to db

    Problem.. Couldnot loop multiple records which time out failure
    From excel values are loading into database.

    3 conditions need to be satisfied for loading excel values to table.

    a)There are certain columns.. If these column has 0 or improper null format,
    that should change as " "
    b)There is one Date column which should have current date
    c)another column should append 2 other columns
    eg) column3=column1 | column2 (ab= a | b)

    If these conditions used in dot net loop, it is tough to loop inside lakhs of records
    to satisfy this condition.

    Is there way in dot net to make it fast or any excel validation possible which can be done in excel itself.
  • #764713
    Hi lilly,

    As per my understand the post you want to compare excel data with your database result right?

    If that is the case you need to get the excel sheet data into one datatable and database result into another datatable and then compare both the datatables as you want.

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #764723
    @Naveen :


    There is no compare happening here..

    Just need to loop thousands of records..

    for( )
    {
    if(a=="")
    {
    var b=string.empty or null
    }
    if(a=="createddate")
    {
    var date=sysdate;
    }
    }


    Since conditions implied under loop, time out error occurs.. is there any other way to satisfy this condition without loop

  • #764725
    Hi lilly,

    If you want to check all the records then without looping that's not possible, if you want to check only few records based on some condition then that is possible without loop also.

    Ex:

    DataRow[] dr = table.Select("col1 like 'yoursearching'").FirstOrDefault();

    if(dr != null && dr["col1"].ToString()=="")
    {
    //do something here
    }


    Hope this will helpful to you....

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/


Sign In to post your comments