SqlConnection con = new SqlConnection(connect);
con.Open();
string sql = "select * from flash";
SqlCommand com = new SqlCommand(sql,con);
com.ExecuteNonQuery();
DataTable dtb = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(sql, con);
da.Fill(dtb);
if (dtb.Rows.Count > 0)
{
SqlConnection con1 = new SqlConnection(connect);
con1.Open();
System.Text.StringBuilder str = new System.Text.StringBuilder();
str.AppendLine("select replace(flashPic,'flashPic','@flashPic') from flash");
SqlCommand com1 = new SqlCommand(str.ToString(),con);
com1.Parameters.AddWithValue("@flashPic",flashup);
com1.ExecuteReader();
con1.Dispose();
}
else
{
SqlConnection con2 = new SqlConnection(connect);
con2.Open();
System.Text.StringBuilder str = new System.Text.StringBuilder();
str.AppendLine("insert into flash (flashPic) values (@flashPic) ");
SqlCommand com2 = new SqlCommand(str.ToString(), con);
com2.Parameters.AddWithValue("@flashPic", flashup);
com2.ExecuteReader();
con2.Dispose();