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.5k
compare the database
Mar 23 2015 3:08 AM
i had a code in which text box 2 accepts the two strings and i would like to compare them with the database i had done the code to split the text box 2 sting into multiple and stored in
myarray
SqlCommand cmd = new SqlCommand("insert comparative values('" + TextBox1.Text + "','" + TextBox2.Text + "')", con);
string[] myArray = TextBox2.Text.Split(new Char[] { '&' });
cmd.ExecuteNonQuery();
cmd.Connection = con;
cmd.CommandText = "select * from places where names = @myArray ";
cmd.Parameters.AddWithValue("@myArray", myArray.ToString());
SqlDataReader sdr = cmd.ExecuteReader();
if (sdr.Read())
{
Label4.Text = TextBox2.Text;
}
else
{
Label4.Text = "Not Found";
}
con.Close();
con.Close();
Reply
Answers (
4
)
i will like to retrieve the element which is not like same
Need to update specific row from a specific date