how to get excel data as xml in c# codehttp://forums.asp.net/t/1779240.aspx/1?how+to+get+excel+data+as+xml+in+c+codeWed, 14 Mar 2012 09:31:05 -040017792404874966http://forums.asp.net/p/1779240/4874966.aspx/1?how+to+get+excel+data+as+xml+in+c+codehow to get excel data as xml in c# code <p>hi i want to pass axcel sheet as xml to my store procedure..i was doing this by getting values in data table and then convetring that data table to exml..but i found when when i add a line at the end of sheet and then delete that ..even than when my sheet is loaded in data table it gives me blank rows at end which cause error in my case.i want to avoid that error.</p> <p>so want to know some easy and direct way to convert excel to xml or some way to avoid those blank lines.</p> 2012-03-12T09:23:20-04:004874976http://forums.asp.net/p/1779240/4874976.aspx/1?Re+how+to+get+excel+data+as+xml+in+c+codeRe: how to get excel data as xml in c# code <p>Refer this post: <a href="http://forums.asp.net/t/1598497.aspx/1">http://forums.asp.net/t/1598497.aspx/1</a></p> 2012-03-12T09:30:26-04:004875013http://forums.asp.net/p/1779240/4875013.aspx/1?Re+how+to+get+excel+data+as+xml+in+c+codeRe: how to get excel data as xml in c# code <p><a href="http://forums.asp.net/t/1448348.aspx/1">http://forums.asp.net/t/1448348.aspx/1</a></p> <p><a href="http://www.codeproject.com/Articles/10581/Convert-Excel-to-XML-file-XML-Schema-and-validate">http://www.codeproject.com/Articles/10581/Convert-Excel-to-XML-file-XML-Schema-and-validate</a></p> 2012-03-12T09:44:22-04:004875127http://forums.asp.net/p/1779240/4875127.aspx/1?Re+how+to+get+excel+data+as+xml+in+c+codeRe: how to get excel data as xml in c# code <p>can't i add criteria here when selecting from excel sheet</p> <p>select * from [Sheet1&#36;] ??</p> <p>i dont want to select every thing from excel sheet.i want to apply a check like if column one value is empty then skip that</p> <p>is something like this is possible here??</p> 2012-03-12T10:30:49-04:004878566http://forums.asp.net/p/1779240/4878566.aspx/1?Re+how+to+get+excel+data+as+xml+in+c+codeRe: how to get excel data as xml in c# code <p></p> <blockquote><span class="icon-blockquote"></span> <h4>shumailaAjk</h4> but i found when when i add a line at the end of sheet and then delete that ..even than when my sheet is loaded in data table it gives me blank rows at end which cause error in my case.i want to avoid that error.</blockquote> <p></p> <p>When do you do thatDo you mean you do that after make a connection to the Excel file successfully and you change the excel file</p> 2012-03-14T01:36:12-04:004878720http://forums.asp.net/p/1779240/4878720.aspx/1?Re+how+to+get+excel+data+as+xml+in+c+codeRe: how to get excel data as xml in c# code <p>NO this was happining when i update my excel sheet supose i add two more records first save that</p> <p>then i delete those two records and save my excel sheet..now when i was trying to upload that sheet it gives two empty lines at the end</p> <p>those empty lines&nbsp; were creating problem for me.now i manage this by changing my query like this</p> <p>select * from [Sheet1&#36;] where sap_id is not null</p> <p>so now i m not facing that issue.:-)</p> 2012-03-14T04:40:50-04:004878735http://forums.asp.net/p/1779240/4878735.aspx/1?Re+how+to+get+excel+data+as+xml+in+c+codeRe: how to get excel data as xml in c# code <p></p> <blockquote><span class="icon-blockquote"></span> <h4>shumailaAjk</h4> <p></p> <p>i add two more records first save that</p> <p>then i delete those two records and save my excel sheet..now when i was trying to upload that sheet it gives two empty lines at the end</p> <p>those empty lines&nbsp; were creating problem for me.now i manage this by changing my query like this</p> <p>select * from [Sheet1&#36;] where sap_id is not null</p> <p></p> </blockquote> <p></p> <p>So you mean this happens when you</p> <p>1upload an original excel file onto Server</p> <p>2Add rows</p> <p>3Delete rows</p> <p>4Read them outand found two empty rows</p> 2012-03-14T04:51:52-04:004878822http://forums.asp.net/p/1779240/4878822.aspx/1?Re+how+to+get+excel+data+as+xml+in+c+codeRe: how to get excel data as xml in c# code <p>no i was adding and deleting&nbsp;before uploding... but still it&nbsp;was picking some empty rows at the end.</p> 2012-03-14T05:43:16-04:004878939http://forums.asp.net/p/1779240/4878939.aspx/1?Re+how+to+get+excel+data+as+xml+in+c+codeRe: how to get excel data as xml in c# code <p></p> <blockquote><span class="icon-blockquote"></span> <h4>shumailaAjk</h4> <p></p> <p>no i was adding and deleting&nbsp;before uploding... but still it&nbsp;was picking some empty rows at the end.</p> <p></p> </blockquote> <p></p> <p>That's a little strangeWellyou can check whether your string.IsNullOrEmpty(DataTable.Rows[index][Field-index])If yesdelete the whole rowafter doing this and submit:-)</p> 2012-03-14T06:31:32-04:004879356http://forums.asp.net/p/1779240/4879356.aspx/1?Re+how+to+get+excel+data+as+xml+in+c+codeRe: how to get excel data as xml in c# code <p>:-) it is really strange.but its really hapening.&nbsp;thanks for solution</p> 2012-03-14T09:31:05-04:00