Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't display results where the ending matches
    text
    copied!<p>I'm making a rhyme dictionary, and I have a database table with 3 coloumns, the user will search the database and the search keywords will search database where the ending of the word matches with the word in textbox.</p> <p>When I enter some keyword into textbox</p> <p><strong>I get ERROR: Incorrect syntax near the keyword 'LIKE'.</strong></p> <p><a href="http://i.stack.imgur.com/6seUH.png" rel="nofollow"><strong>This is how my database looks like</strong></a></p> <p>Here is how my aspx looks like:</p> <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %&gt; &lt;!DOCTYPE html&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head runat="server"&gt; &lt;title&gt;Kafiye Dizini - Türkçe Kafiye Bulma Sözlüğü - Uyak Bulucu Sözlük - İstediğiniz harf ile biten kelimeleri bulan sözlük&lt;/title&gt; &lt;meta name="description" content="İstediğiniz harfler ile biten kelimeleri bulmanızı sağlayan sözlük" /&gt; &lt;link rel="shortcut icon" type="image/x-icon" href="favicon.ico" /&gt; &lt;link href="style.css" rel="stylesheet" /&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;div&gt; &lt;div class="top"&gt; &lt;div class="email"&gt;İletişim: fahrettinveysel@gmail.com&lt;/div&gt; &lt;/div&gt; &lt;div class="leftcontainer"&gt; &lt;/div&gt; &lt;div class="middlecontainer"&gt; &lt;div class="title"&gt;Kafiye Dizini&lt;/div&gt; &lt;div class="subtitle"&gt;İstediğiniz harf veya hece ile biten kelimeleri bulmanızı sağlayan sözlük&lt;/div&gt; &lt;div class="searchcontainer"&gt; &lt;asp:TextBox ID="TextBox1" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /&gt; &lt;/div&gt; &lt;div class="resultboxcontainer"&gt; &lt;div id="resultbox1" runat="server"&gt;&lt;/div&gt; &lt;div id="resultbox2" runat="server"&gt;&lt;/div&gt; &lt;div id="resultbox3" runat="server"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class="idefix"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class="rightcontainer"&gt; &lt;div class="ornekarama"&gt; &lt;div class="ornekaramabaslik"&gt;Örnek Arama&lt;/div&gt; &lt;input type="text" class="ornekaramatextbox" value="rop" disabled="disabled" /&gt; &lt;div class="ornekaramasonuclar"&gt;filantrop&lt;br /&gt;gardırop&lt;br /&gt;hipermetrop&lt;br /&gt;mikrop&lt;br /&gt;mizantrop&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>and this is my aspx.cs</p> <pre><code>using System; using System.Collections.Generic; using System.Data.SqlClient; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } SqlConnection cnn = new SqlConnection("Initial Catalog=kafiyedizini;Data Source=localhost;Integrated Security=SSPI;"); protected void Button1_Click(object sender, EventArgs e) { if (TextBox1.Text != "") { cnn.Open(); SqlCommand cmd = new SqlCommand("SELECT kelime1,kelime2,kelime3 FROM kelimeler LIKE @arama", cnn); cmd.Parameters.AddWithValue("@arama", "%" + TextBox1.Text); SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { resultbox1.InnerHtml += dr.GetString(0); resultbox2.InnerHtml += dr.GetString(1); resultbox3.InnerHtml += dr.GetString(2); } } cnn.Close(); } else { resultbox1.InnerHtml += "please enter data"; } } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload