PDA

Click to See Complete Forum and Search --> : no of rows one excel sheet could accomodate


noshaba
Oct 30th, 2006, 01:52 AM
Plz any one help me in this regard ...
I need to save data from my SQL server table to en excel file ... Now i need to know how many records could be accomodated in one worksheet ... If records get more than 1 sheet will it automatically move to 2nd work sheet or we have to control it manually.

jmcilhinney
Oct 30th, 2006, 02:11 AM
The number of rows an Excel sheet can hold is hardly a C# question. You should go to MSDN and read about Excel and the capabilities of each version. As for whether anything will automatically go to the next sheet, no matter how you're interacting with Excel you always specify the worksheet so if you want to change worksheets you have to specify the new one.

RobDog888
Oct 30th, 2006, 02:26 AM
Excel can hold 65,535 rows on a single sheet.

How are you exporting the SQL data?

noshaba
Oct 30th, 2006, 04:47 AM
thnx rob .. m just extracting data from table to a dataset and then thru data set export all rows to an excel file

jmcilhinney
Oct 30th, 2006, 05:57 AM
As I said, when you interact with an Excel sheet you have to specify which sheet it is. If you're using ADO.NET then you use the sheet name as the table name in your SQL code. If you specify the name of a sheet that has too many rows then ADO.NET won't simply ignore your sheet specification and arbitrarily put the data into another worksheet. It will throw an exception.

RobDog888
Oct 30th, 2006, 09:48 AM
Well that is why you would want to keep track of the number of records.