title: System.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'FROM'
body: <p>I am trying to create a web in ASP.net where it shows me publications that our organization puts out. Here's some code from the cs file. </p>
  
  <pre><code>//2nd - Setup SQL Command
      SqlCommand cmd = new SqlCommand("SELECT [IDTip], [Date], CONVERT(nvarchar(100),[Date], 1) AS Released, [Title], [Image], REPLACE(CONVERT (nvarchar(MAX),[Tip]), '&lt;/p&gt;\r\n\r\n&lt;p&gt;', '&lt;p&gt;&lt;/p&gt;') AS ContentConverted, Recognition, FROM tips WHERE IDTip =" + Request.QueryString["IDTip"], new SqlConnection(HealthReachConString));
  
  //3rd - Attempt to open the connection to the DB
      cmd.Connection.Open();
  
  //4th - Go and fetch some data and apply it to our controls
      SqlDataReader objReader = cmd.ExecuteReader();
      while (objReader.Read())
      {
          lblDate.Text = objReader.GetString(2);
          lblTitle.Text = objReader.GetString(4);
          lblTip.Text = Convert.ToString(objReader["ContentConverted"]);
          imgContentPicture.ImageUrl = "~/files/Health_Tips/" + objReader.GetString(5);
          if (objReader.GetString(5) == " " || objReader.GetString(5) == "")
          {
              imgContentPicture.Visible = false;
          }
          else
          {
              imgContentPicture.Visible = true;
          }
  
      }
      objReader.Close();
      cmd.Connection.Close();
  </code></pre>
  
  <p>Here's the error that I get. </p>
  
  <blockquote>
    <p>Server Error in '/' Application.<br>
    Incorrect syntax near the keyword 'FROM'.<br>
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.<br>
    Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'FROM'.</p>
    
    <p>Source Error:</p>
    
    <p>Line 23:<br>
        Line 24:         //4th - Go and fetch some data and apply it to our controls
        Line 25:         SqlDataReader objReader = cmd.ExecuteReader();<br>
        Line 26:         while (objReader.Read())<br>
        Line 27:         {</p>
    
    <p>Stack Trace:</p>
    
    <p>[SqlException (0x80131904): Incorrect syntax near the keyword 'FROM'.]<br>
            System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +1791910<br>
           System.Data.SqlClient.SqlInternalConnection.OnError(SqlException 
        exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5347106
           System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObjec>t stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +546<br>
           System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean&amp; dataReady) +1693<br>
           System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() +61<br>
           System.Data.SqlClient.SqlDataReader.get_MetaData() +90<br>
           System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, 
        RunBehavior runBehavior, String resetOptionsString) +377<br>
           System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task&amp; task, Boolean asyncWrite, SqlDataReader ds) +1421<br>
           System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task&amp; task, Boolean asyncWrite) +177<br>
           System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +53
           System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +137<br>
           System.Data.SqlClient.SqlCommand.ExecuteReader() +99<br>
           PressRoom_Detail.Page_Load(Object sender, EventArgs e) in E:\web\healthreach\htdocs\Tips_Detail.aspx.cs:25<br>
           System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51<br>
           System.Web.UI.Control.OnLoad(EventArgs e) +92<br>
           System.Web.UI.Control.LoadRecursive() +54<br>
           System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772</p>
  </blockquote>
  
  <p>Any idea what's going on?</p>