Hi All,
Any idea here how to parse excel files data in ASP.NET WebForms using C# or ASP.NET MVC using C#?
Thank you
Printable View
Hi All,
Any idea here how to parse excel files data in ASP.NET WebForms using C# or ASP.NET MVC using C#?
Thank you
Hope this helps
In addition to the above suggestion, you can look into using the Office Interop DLL's to read the excel file. This isn't a particularly "pretty" way of doing it, but depending on your requirements, you might need to do this.
Here is an example:
http://www.dotnetspider.com/resource...tas-using.aspx
Gary
Thanks for the help, I will give you updates as soon as possible
jsc0624,
Sounds like a plan, hope you get it working!
Gary
I have successfully transferred the content of my excel files into dataset but the problem is:
Although it loops I can only extract the data of the first row.Code:foreach (DataRow row in objDataSet1.Tables[0].Rows)
{
string name = row.Table.Rows[0]["FirstName"].ToString();
string last = row.Table.Rows[0]["LastName"].ToString();
}
Thanks in advance.
Why are you going into another table in the row? Is this necessary?
Gary
Hi Gary,
You are right, I don't need to go to another table in the row. I change the code to this:
Thanks for the help guys!Code:foreach (DataRow row in objDataSet1.Tables[0].Rows)
{
string name = row.Field<string>("FirstName").ToString();
string last = row.Field<string>("LastName").ToString();
}
Hey,
Glad to hear that you got it working!
Gary