Click here to Skip to main content
15,798,592 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<div ng-app="MyApp" ng-controller="MyController">
    <table cellpadding="0" cellspacing="0">
        <tbody ng-repeat="m in Customers">
<script type="text/javascript">
    var app = angular.module('MyApp', [])
    app.controller('MyController', function ($scope, $http, $window) {
        var get = $http({
            method: "GET",
            url: ""

        get.success(function (data, status) {
            $scope.Customers = data;

        get.error(function (data, status) {

What I have tried:

string sql = "INSERT INTO NameTable (symbol,bidPrice,bidQty) VALUES (@symbol,@bidPrice,@bidQty)";
   using (SqlCommand command = new SqlCommand(sql, conn))
       command.Parameters.AddWithValue("@symbol", "symbol");
       command.Parameters.AddWithValue("@bidPrice", "bidPrice");
       command.Parameters.AddWithValue("@bidQty", "bidQty");
Updated 28-Aug-23 10:26am

Probably, you need to change this:
command.Parameters.AddWithValue("@symbol", "symbol");
command.Parameters.AddWithValue("@bidPrice", "bidPrice");
command.Parameters.AddWithValue("@bidQty", "bidQty");
To this:
command.Parameters.AddWithValue("@symbol", symbol);
command.Parameters.AddWithValue("@bidPrice", bidPrice);
command.Parameters.AddWithValue("@bidQty", bidQty);
Share this answer
Richard Deeming 29-Aug-23 4:20am    
And probably clear out the parameters collection after executing the query. :)
OriginalGriff 29-Aug-23 5:15am    
Hey, one problem at a time ... :D

It's in a using block, so the whole command will be Disposed when finished with, which will Dispose the parameters etc.
You haven't provided enough information. You didn't describe a problem you're having with this code, not any error messages.

The HTML/Javscript code you posted makes no attempt to call a controller method to put any data in the database and the SQL code you posted is incomplete so it's pretty much impossible to tell you what's going on and why.

One thing I will say is your parameters code is trying to insert the strings "symbol", "bidPrice", and "bidQty" into the database, not any actual data.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900