Click here to Skip to main content
15,901,122 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am creating a Windows Forms Application using Visual Studio 2008.
I am reading excel like this

string strQuery = "Select * from [{0}]";
                       OleDbCommand cmd = new OleDbCommand(string.Format(strQuery, strSheetName));
                       cmd.Connection = connection;
                       OleDbDataAdapter adapter = new OleDbDataAdapter(cmd);
                       adapter.Fill(dataSet, (string)strSheetName);


But merge cells are not showing the data. like cell[5,4] has "x" and which is merged with cell[6,4] in this condition cell[6,4] is blank where i want the data to be repeated. anyone got this problem please help.
Posted

1 solution

Technically, that's not wrong.

If cell[5,4] = "x" and cell[6,4] = "x" and you merge them, then both of them still contain "x" even though they're merged.

If cell[6,4] was blank when you merged it, it remains blank even after merging.

I found that out the hard way while I was doing filtering.
 
Share this answer
 
Comments
snehalgb 25-Apr-12 7:38am    
But it is too bad as i want the data there. I think there is no way than reading excel cell by cell and check for merge and do the next step. but it slows down the system.
it is very bad

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900