I would like to know if is posible parse a excel to json.
And if is possible which is the structure of the excel to make it possible.
There is an application or something??
I have this JSON sructure http://pastie.org/2760828
And I have to insert 500 products and i would like insert into excel and parse them.
解决方案
You can do it like this:
1) First convert your excelsheet to datatable
2) And then convert your datatable to json like below:
1) conversion excel sheet to datatable
string ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=G:\school pro\schools3.xlsx;
Extended Properties=Excel 5.0";
StringBuilder stbQuery = new StringBuilder();
stbQuery.Append("SELECT top 10 * FROM [A1:M98]");
OleDbDataAdapter adp = new OleDbDataAdapter(stbQuery.ToString(), ConnectionString);
DataTable dtSchools = new DataTable();
adp.Fill(dtSchools);
2) conversion datatable to json
Newtonsoft.Json.JsonConvert.SerializeObject(dtSchools)