01.
private
void
button1_Click(
object
sender, EventArgs e)
02.
{
03.
string
sql = textBox1.Text;
04.
MySqlConnection con =
new
MySqlConnection(
"host=localhost;user=root;password=12345678;database=postsystem"
);
05.
MySqlCommand cmd =
new
MySqlCommand(sql, con);
06.
System.Data.DataTable dt = GetTableForm(sql,
"ConnString"
);
07.
if
(GetTableForm(
"select * from table where ID = "
+
"11"
,
"ConnString"
).Rows.Count > 0)
08.
{
09.
MessageBox.Show(
"Yes"
);
10.
}
11.
else
12.
{
13.
MessageBox.Show(
"No"
);
14.
}
15.
con.Open();
16.
cmd.ExecuteNonQuery();
17.
con.Close();
18.
}