title: Error converting data type nvarchar to bigint but I already use Convert.ToInt64
body: <p>I have a input textbox in my view what only accept number:</p>
  <pre><code>&lt;input asp-for=&quot;order&quot; class=&quot;form-control&quot; MaxLength=&quot;120&quot; type=&quot;number&quot; /&gt;
  </code></pre>
  <p><code>Order</code> is a <code>bigint</code> column in the database table.</p>
  <p>Then in the controller I write the following code:</p>
  <pre><code>parameters.Add(new SqlParameter(&quot;@order&quot;, Convert.ToInt64(obj.order)));
  parameters.Add(new SqlParameter(&quot;@extra&quot;, obj.extra));
  
  var objList = _db.Database.ExecuteSqlRaw(&quot;update @order, @extra&quot;, parameters.ToArray());
  </code></pre>
  <p>But I keep getting the same error whatever I try to change. The error is:</p>
  <blockquote>
  <p>Error converting data type nvarchar to bigint</p>
  </blockquote>
  <p>Also when I just put a number in the <code>SqlParameter</code> it's not working like:</p>
  <pre><code>parameters.Add(new SqlParameter(&quot;@order&quot;, Convert.ToInt64(&quot;10000&quot;)));
  </code></pre>
  <p>The update stored procedure is just very simple:</p>
  <pre><code>(
      @extra nvarchar(MAX),
      @order bigint
  )
  AS
  BEGIN
      UPDATE dbo.table
      SET extra = @extra 
      WHERE order = @order
  END
  RETURN 0
  </code></pre>