从数据库中提取特定单元格计算,网络矩阵
我目前正在与 Webmatrix 合作,尝试设计一个网络应用程序。我正在尝试创建一个网站,允许用户使用图表分析数据库中的数据。我创建了一个数据库,我想从中提取特定单元格内的 int 值并将其与另一个单元格相乘,然后绘制输出图,就像 Excel 工作表一样。事实上,我有一个 Excel 工作表,我基本上想将其变成一个交互式网络应用程序。
我在尝试绘制结果图表时遇到了问题。下面是我尝试过的代码。
@{
var db = Database.Open("myDatabase") ;
var sql = "SELECT myFirstColumn FROM myDatabase WHERE Id = 5";
var fifth = db.QueryValue(sql);
sql = "SELECT mySecondColumn FROM myDatabase WHERE Id = 6";
var sixth = db.QueryValue(sql);
var calculation = sixth * fifth;
var grid = new WebGrid(calculation);
}
另外,我尝试通过创建 var Chart,然后使用 write() 函数来省略 WebGrid()。这也失败了。我正在 .cshtml 页面中创建所有这些。非常感谢任何帮助。
如果有人觉得我使用 Webmatrix 创建此类 Web 应用程序走上了错误的道路,请告诉我并告诉我哪种语言/平台最好。如果需要,我愿意学习新的平台和/或语言。我不想浪费太多时间才意识到自己走错了路。再次感谢!
I am currently working with Webmatrix, attempting to design a web app. I am trying to create a site that allows users to analyze data from a database using graphs. I have created a database from which I would like to extract the int value from within a particular cell and multiply it with another, then graph the output, much like an Excel sheet does. In fact, I have an excel sheet that I am basically trying to turn into an interactive web app.
I am running into an issue when trying to graph the result. Below is code that I have tried.
@{
var db = Database.Open("myDatabase") ;
var sql = "SELECT myFirstColumn FROM myDatabase WHERE Id = 5";
var fifth = db.QueryValue(sql);
sql = "SELECT mySecondColumn FROM myDatabase WHERE Id = 6";
var sixth = db.QueryValue(sql);
var calculation = sixth * fifth;
var grid = new WebGrid(calculation);
}
Also, I have tried to leave out the WebGrid() by creating a var Chart, then using the write() function. This has also failed. I am creating all of this within a .cshtml page. Any help is greatly appreciated.
If anyone feels that I am taking the wrong route by using Webmatrix to create this sort of web app, please let me know and tell me what language/platform would be best. I am open to learning a new platform and/or language if needed. I don't want to waste too much time before realizing I'm taking the wrong route. Thanks again!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该能够使用以下代码来执行此操作:
您提到的失败的图表代码做了什么?
You should be able to do this with the following code:
What did the chart code you referred to as failing do?