Private Sub ExecuteNonQuery(ByVal Value As String)
Using con As New OleDbConnection(ConfigurationManager.ConnectionStrings("TestLocal").ConnectionString)
Dim cmd As New OleDbCommand(Value, con)
con.Open()
cmd.ExecuteNonQuery()
con.Close()
End Using
End Sub
The above code in VB.NET I want to convert that to javascript and call it in the javascript side. I don't know how to connect to access and execute a query even an update query in the javascript side. Any help on this would be greatly appreciate it.
This is so far what I have done in the javascript swide of things:
<script type="text/javascript">
alert("I am before function");
function SaveAllRecords() {
//alert("I have entered function!");
var gvReport = document.getElementById("<%= GridView1.ClientID %>");
// alert("I have declared variables");
for (i = 1; i<gvReport.rows.length; i++)
{
//alert("Row: " + i);
var cell = gvReport.rows[i].cells;
var IconTypes = 9;
var string = '<span id="MainContent_GridView1_lblWorkOrderItemID_' + (i-1) + '">';
//alert(string);
var WorkOrderItemID = cell[1].innerHTML.replace(string, '');
WorkOrderItemID = WorkOrderItemID.replace("</span>", "");
//alert(WorkOrderItemID);
var Qty = cell[3].innerHTML;
string = '<span id="MainContent_GridView1_idQty_' + (i - 1) + '">';
//alert(Qty);
Qty = cell[3].innerHTML.replace(string, '');
//alert(Qty);
Qty = Qty.replace("</span>", "");
//alert(Qty);
var idText = cell[8].innerHTML;
var res = idText;
res = res.substr(0, 99);
//alert(res);
string = '<input name="ctl00$MainContent$GridView1$ctl0'+(i+1)+'$idTxt" type="number"';
//alert(string);
res = res.replace(string, "");
//alert(res);
string = 'value=';
//alert(string);
res = res.replace(string, "");
//alert(res);
//alert(res.replace(/"([^"]+(?="))"/g, '$1'));
res = res.replace(/"([^"]+(?="))"/g, '$1');
//alert(res);
alert("This is before calling pagemethod.");
}
//alert("I have existed the for loop!");
}
</script>
Please any help in this would be greatly appreciate it.