title: Error converting data type bigint to int [SQL Server]
body: <p>I have to insert a phone number into the database using stored procedure.. But while inserting it is showing the error as</p>
  
  <blockquote>
    <p>SqlException: Error converting data
    type bigint to int.</p>
  </blockquote>
  
  <pre><code>long phoneNumber = Convert.ToInt64(Phone.Text);
  
  cmd.CommandType = CommandType.StoredProcedure;
  
  cmd.Parameters.AddWithValue("@phone",phoneNumber);
  
  cmd.ExecuteNonQuery();
  </code></pre>
  
  <p>ie for this parameter,
  DBType is Int64
  SQLDbType is BigInt</p>
  
  <p>I have used BigInt as the DataType of the column in SQL Server also.</p>
  
  <p>So what could be going wrong here..</p>
  
  <p>I find that  1999999999 [&lt;2^32 ]is getting inserted properly and 2999999999 [>2^32]is not</p>
  
  <p>Please tell if you need anymore info</p>
  
  <p>Thanks in Advance</p>