title: Truncate Table C# Cannot Find Table - Does not Exist or no Permission
body: <p>I'm going to use my full table name because I'm trying to pinpoint what I'm doing wrong as to why the table can't be found.</p>
  
  <p>I'm trying to truncate a table within C#. I am able to run this command, <code>"TRUNCATE TABLE NS_Vendor"</code> within SQL Server and it correctly finds and truncates the table.</p>
  
  <p>If I try to do this in my C# application, I'm told does not exist or no permission. I'm using DB admin account so it can't be permission. I'm using the code below. I'm inside of the database named Public with admin user credentials and I'm looking to truncate the <code>"NS_Vendor"</code> table. The cmd below works in SQL Server. I've tried different strings like <code>"dbo.NS_Vendor"</code> amongst others but none of them work.</p>
  
  <p>Would someone mind pointing out to me what I'm not understanding about what I'm doing wrong?</p>
  
  <pre><code>SqlConnection sqlConnection = new SqlConnection("Server = server; Database = Public; User = ; Password = ;");
              string query = "TRUNCATE TABLE " + "NS_Vendor";
              SqlCommand cmd = new SqlCommand(query, sqlConnection);
              sqlConnection.Open();
              cmd.ExecuteNonQuery();
              sqlConnection.Close();
  </code></pre>