title: I'm getting this error "System.Data.SqlClient.SqlException: 'Incorrect syntax near '.'.'"
body: <p>I'm getting this error in my query but does not see where the problem occurs. I'm still new to sql and need your help. The error appears at the last code &quot;commandType.Text......&quot; Here is my code.</p>
  <pre><code>public void DeletePaymentId(string paymentid)
   {
     _connectionString = ConnectionString = GetUrlForPaymentDb();
      var paymentId = SetupSqlConnection(
        $&quot;DELETE p &quot; +
        $&quot;FROM[dbo].[Payment] p &quot; +
        $&quot;INNER JOIN[dbo].[Booking] b ON b.BookingNumber = p.BookingNumber &quot; +
        $&quot;WHERE p.PaymentId = '{paymentid}' &quot;,
      
      CommandType.Text, cmd =&gt; cmd.ExecuteNonQuery());
  }
  </code></pre>