使用javascript和c#将数据从HTML表保存到数据库 [英] Save data from HTML table to data base using javascript and c#

查看:88
本文介绍了使用javascript和c#将数据从HTML表保存到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Experts,

我在html表中显示了大量数据。

按钮单击使用java脚本json我将数据行发送到数据使用c#代码的基础。

对于这个过程大约需要20到30分钟。但我想让它变胖。

所以任何建议都会有所帮助。

谢谢你,

你的追随者。

Hello Experts,
I have a large amount of data displaying in a html table.
On button click using java script json I am sending data row wise to data base using c# code.
For this process it takes around 20 to 30 mins. But I want to make it fat.
So any suggestion will be helpful.
Thank you,
Your follower.

推荐答案

请看我对这个问题的评论。

考虑使用这个: https://www.npmjs.org/package/htmlparser [ ^ ]。



参见: http://ejohn.org/blog/pure-javascript-html-parser [ ^ ]。



尝试自己搜索:http://bit.ly/1hmkFs2 [ ^ ]。



但是将数据存储在HTML中的整个想法都很糟糕。 HTML应仅用于向人类用户提供数据。它只能用于 Web抓取,但这样的报废不需要Javascript,可以使用一些编译语言来完成,具体取决于您的平台。



-SA
Please see my comments to the question.
Consider using this: https://www.npmjs.org/package/htmlparser[^].

See also: http://ejohn.org/blog/pure-javascript-html-parser[^].

Try to do your own search: http://bit.ly/1hmkFs2[^].

But the whole idea to store data in HTML is bad. HTML should be used only to present data to human users. It can be marginally justified only for Web scraping, but such scrapping does not need Javascript, could be done using some compiled language, something depending on your platform.

—SA


Quote:

我要插入单击一下按钮即可记录8000条记录。

这是我的代码。

--------------------- ----------------------------------





函数ADDDOCPOSTDetails(){

var BillType =

I am inserting arount 8000 records at one button click.
Here is my code.
-------------------------------------------------------


function ADDDOCPOSTDetails() {
var BillType =


('input:radio [name = IP_OP_Pharm_All]:checked')。 val();

var dropdown = document.getElementById(ddlyear);

var index = dropdown.selectedIndex;

var ddlyear = dropdown.options [index] .value;

var ddText = dropdown.options [index] .text;



var dropdown1 = document。 getElementById(ddlmonth);

var index1 = dropdown1.selec tedIndex;

var ddlmonth = dropdown1.options [index1] .value;

var YearMonth = ddlyear + ddlmonth;

deletedadocpost(YearMonth,BillType );


('input:radio[name=IP_OP_Pharm_All]:checked').val();
var dropdown = document.getElementById("ddlyear");
var index = dropdown.selectedIndex;
var ddlyear = dropdown.options[index].value;
var ddText = dropdown.options[index].text;

var dropdown1 = document.getElementById("ddlmonth");
var index1 = dropdown1.selectedIndex;
var ddlmonth = dropdown1.options[index1].value;
var YearMonth = ddlyear + ddlmonth;
deletedadocpost(YearMonth, BillType);


这篇关于使用javascript和c#将数据从HTML表保存到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆