TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mohit Kapoor
1.6k
94
19.9k
Search from DB with LIKE Operator
Aug 28 2016 4:46 PM
I am getting an incorrect syntax error on following code .
There's an error in Sql query ?
protected void btnByName_Click(object sender, EventArgs e)
{
string name = txtByName.Text.Trim();
Response.Write("clicked \n");
cmd.Connection = con;
cmd.CommandText = "select * from books where name LIKE '%' "+name+" '%' ";
con.Open();
rdr=cmd.ExecuteReader();
if(rdr.Read())
{
Response.Write(" found <br>");
GridView1.DataSource = rdr;
GridView1.DataBind();
}
else
Response.Write("no match found");
con.Close();
}
Reply
Answers (
4
)
Selected District not retrieved for employee in edit view ge
how to create a layout for the partial view in mvc4 ?/