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
Krishna
NA
37
9.4k
geeting an error
Mar 18 2015 2:11 AM
this is my code trying to compare the strings in the text box2 and display the matched string in the label i am getting an error please help me
protected void Button1_Click(object sender, EventArgs e)
{
SqlCommand cmd = new SqlCommand("insert comparative values('" + TextBox1.Text + "','" + TextBox2.Text + "')", con);
cmd.ExecuteNonQuery();
SqlDataReader reader = null;
// cmd.Parameters.AddWithValue("@name", TextBox2.Text);
//cmd.Parameters.AddWithValue("SELECT FROM places where name=@name",TextBox2.Text);
cmd.Parameters.AddWithValue("select textbox2.text from places where
[email protected]
",con);
reader = cmd.ExecuteReader();
while (reader.Read())
{
TextBox2.Visible = true;
TextBox2.Text = Convert.ToString(reader["TextBox2"]);
}
Label4.Text= TextBox2.Text;
con.Close();
}
Reply
Answers (
6
)
Dymo Label Printing in .Net Help Please
javascript runtime error