Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6671041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:20:25+00:00 2026-05-26T03:20:25+00:00

in web application, i have a gridview in that each row contain 3 textboxes

  • 0

in web application, i have a gridview in that each row contain 3 textboxes and gridview contain 127 rows. I have to insert the data of each textbox into database, for this i created a data table and i collect the data of each textbox into that data table and convert the data table into xml form, then inserted into database, but it is giving performence issue[infact it is giving time out exeception], is there any good process to insert the data into database. thank you.

        CREATE procedure [dbo].[USP_RollPlan_InsertProducts](@xmldata xml)                  
    as                  
    begin      
    declare @rollingplainid int      
    declare @xproductcode varchar(30)    
    declare @xQantity1 decimal    
    declare @xRollplanyear int    
    declare @xRollplanmonthYear date    
    declare @xempid varchar(8)    
    declare @xsession varchar(60)    
    declare @xcandflocation int    

    SELECT                         
    cast(convert(nvarchar(max),colx.query('data(productcode)')) as varchar(30)) as xproductcode,                        
    cast(convert(nvarchar(max),colx.query('data(Qantity1)')) as decimal) as xQantity1,    
    cast(convert(nvarchar(max),colx.query('data(Rollplanyear)')) as int) as xRollplanyear,    
    cast(convert(nvarchar(max),colx.query('data(RollplanmonthYear)')) as date) as xRollplanmonthYear,    
    cast(convert(nvarchar(max),colx.query('data(empid)')) as varchar(8)) as xempid,    
    cast(convert(nvarchar(max),colx.query('data(session)')) as varchar(60)) as xsession,    
    cast(convert(nvarchar(max),colx.query('data(candflocation)')) as int) as xcandflocation    
    INTo #tmpES FROM @xmldata.nodes('DocumentElement/Mytable') AS Tabx(Colx)     


    declare db_cursor cursor for     

    select  xproductcode,xQantity1,xRollplanyear,xRollplanmonthYear,xempid,xsession,xcandflocation from #tmpES    

    open db_cursor    
    fetch next from db_cursor into @xproductcode,@xQantity1,@xRollplanyear,@xRollplanmonthYear,@xempid,@xsession,@xcandflocation     

    while @@FETCH_STATUS =0    
    begin                           

    select  @rollingplainid = max(rollingplanid) from Tbl_F_Roll_PlanHeader_T where  empid=@xempid            
    if not exists ( select * from  Tbl_F_Roll_PlanDetails_T where CreatedBy =@xempid and ProductCode =@xproductcode and RollingPlanId=@rollingplainid   and RollPlanMonthYear =@xRollplanmonthYear     and CandFLocation =@xcandflocation and Status=1 )    


    begin      

        insert into Tbl_F_Roll_PlanDetails_T(rollingplanid,productcode,rollplanmonthyear,rollplanyear,candflocation,quantity,CreatedBy,CreatedOn,sessionid,status)                  
        values(@rollingplainid ,@xproductcode ,@xRollplanmonthYear ,@xRollplanyear ,@xcandflocation ,@xQantity1,@xempid,GETDATE (),@xsession,1)                  
    end              
    else              
    begin        
        if(@xQantity1 =0)        
        begin        
            delete from Tbl_F_Roll_PlanDetails_T where ProductCode=@xproductcode and RollingPlanId =@rollingplainid and CandFLocation =@xcandflocation and RollPlanMonthYear =@xRollplanmonthYear and RollPlanYear =@xRollplanyear         
        end                   
            update Tbl_F_Roll_PlanDetails_T set quantity=@xQantity1,CreatedOn =GETDATE() where ProductCode =@xproductcode and DATEDIFF (dd, RollPlanMonthYear ,@xRollplanmonthYear)=0 and CandFLocation =@xcandflocation and CreatedBy =@xempid                
        end                 

    fetch next from db_cursor into  @xproductcode,@xQantity1,@xRollplanyear,@xRollplanmonthYear,@xempid,@xsession,@xcandflocation     
    end     
    close db_cursor    
    deallocate db_cursor             
    end  
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:20:26+00:00Added an answer on May 26, 2026 at 3:20 am

    First, you should optimize the query as it seems slow and thats why you are getting this exception. Second, you can increase the command timeout to infinite to overcome this exception.

    command.CommandTimeout=0;
    

    See more at http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.commandtimeout.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently writing a web application that have about 6-12 pages. On each one
In my web application I have taken a ajax calendar in that i want
In my web application we have many users.I want to set permission for each
I am building a web application and have been told that using object oriented
I have a web application (with C#). I have a GridView and want to
Does anybody know a gridview for c# web applications or ajax that shows data
I have just create a very basic Dynamic Data web application using Entity Framework,
Does anyone have a solution/link for copying contents of a GridView/Datatable (web application aspx)to
In my web application (asp.net & vb code), I had two different gridview. Each
I have an asp.net web application (c#) in visual studio 2010 that is heavily

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.