Solved

Best way to perform numerous calculations on data from asp.net webpage -- updated with more info

Posted on 2012-04-04
3
186 Views
Last Modified: 2012-06-21
Afternoon All,

My current website project will be created from VS2010Express C#.  
Step 1 would be to read excel contents from users pc, done by using OleDB to Read Excel
         
The goal is to perform numerous and extensive statistic/financial  calculations on this data.  Based on all the calculations I perform the end result is showing charts and statistics on website.

So far the data is in a dataset.  In terms of funtionality... I'm looking to search through rows/columns for specific items... add columns... grab certain rows or columns....
what would offer more functionality for me.  Doing all my calculations from a datatable... or transferring to an array and doing calc there??

appreciate everyones advice and as I'm sure you can tell I'm pretty new to this

thanks
0
Comment
Question by:solarissf
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 23

Accepted Solution

by:
Christopher Kile earned 500 total points
ID: 37814143
You want to read an Excel workbook from your client's workstation, perform calculations using its data, then display the results?  This can be done.  It can't all be done on the client workstation, however, without processing the workbook file as XML, and this is not always possible (earlier versions didn't store workbooks as .DOCX).  The best and most consistent way of doing this is to upload the workbook to your server, process the caluclation there, then return the results in a new Web page.  Does this sound like what you might want to do?
0
 

Author Comment

by:solarissf
ID: 37814352
Yes, I do want to read an excel workbook from a user logging into my website.  I think I have this part successfully done by using the below code.

Unfortunately I do not know what XML is.  Based on how I think this works is based on the below code I have already stripped the users excel sheet and now have the info in my dataset.  Which I was planning on putting in a datatable to run my calculations.  Is there anything wrong with my plan of attack?



using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Data;

using System.Data.OleDb;

 

public partial class _Default : System.Web.UI.Page

{

    protected void Page_Load(object sender, EventArgs e)

    {

        string path =@"C:\Documents and Settings\sforero\Desktop\peer.xlsm";

        string connstr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties=Excel 12.0;"; 

        //string strConn = "Provider= Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + path + "; " + "Extended Properties=Excel 8.0;";

        OleDbConnection conn = new OleDbConnection(connstr);

        string strSQL = "select * from [Data$]";

        OleDbCommand cmd = new OleDbCommand(strSQL, conn);

        DataSet ds = new DataSet();

        OleDbDataAdapter da = new OleDbDataAdapter(cmd);

        da.Fill(ds);

        GridView1.DataSource = ds;

        GridView1.DataBind();

 

 

Open in new window

0
 
LVL 23

Expert Comment

by:Christopher Kile
ID: 37823658
Sorry for the delay in getting back to you, but you certainly took my suggestion and ran with it.  Glad it worked for you, and thanks for the points.
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question