title: SQL INSERT - Invalid column name
body: <p>As some of you may of seen from my previous post I'm new to using C# to create websites (Although I have a fair bit of experience using it for Windows Forms apps). The powers that be are tempting me away from PHP but I keep failing at what I consider the basics.</p>
  
  <p>Anyway, this is my issue. I am trying to create a simple entry into a SQL database. I know my connection to the DB is fine as I can reel off SELECT queries all day long but I'm having trouble with using Insert.</p>
  
  <p>Heres my code:</p>
  
  <pre><code>string filename = "abc123.jpg";
  SqlConnection link = new SqlConnection(//you dont need to see my data here ;));
  string sqlcode = "INSERT INTO file_uploads (upload_filename VALUES ("+filename+")";
  SqlCommand sql = new SqlCommand(sqlcode,link);
  link.open();
  sql.ExecuteNonQuery();
  </code></pre>
  
  <p>This results in "Invalid column name abc123.jpg" returned from the try/catch.</p>
  
  <p>Any help would be appreciated. (I wish they would let me do this in PHP lol!)</p>
  
  <p>Thanks,</p>
  
  <p>Tripbrock</p>