We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Sending Data from Sql Data reader to Excel sheet as a (Snapshot) without looping Statement

Hi , I have a windows C#.Net application , this application want to send a data that get it from Sql data reader into a grid but without a looping e.g.: int i=1; Region.Parameters["@iRegion"].Value=i; SqlDataReader Dr = Region.ExecuteReader(); //Loop process //read the current record //Put each field on the appropriate grid cell //go to next record on the data reader //End loop I''m Using Sql server 2000 as a database and suppose the data reader gets about 10,000 records this is not accepted for the user because it will do more response time, so I want a method that sends the data to : 1- I want to take this data to an Excel file with the same way that done with the grid , but first It should check if there is a previous data available at the Excel sheet if there is a data then , it should remove it first then send the new data to the Excel sheet. If this possible only through (DTS) how I do this by C# code based on the information that comes from Data reader on the Upper Example? 2-IF the looping is Must I heared that there is a methods called (Beginupdate,Endupdate) How I use this methods , explain by peace of C# code. Thanks

Loader.
Live Chat Icon For mobile
Up arrow icon