SHARE
TWEET

Untitled

a guest Jun 19th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {String CS= ConfigurationManager.ConnectionStrings["BudgetDBConnectionString1"].ConnectionString;
  2.         using (SqlConnection con = new SqlConnection(CS))
  3.         {
  4.             SqlCommand cmd = new SqlCommand("insert into Planuri values('" + tbNumeDorinta.Text + "','" + tbTarget.Text + "','" + tbPretE.Text + "')", con);
  5.             con.Open();
  6.             cmd.ExecuteNonQuery();
  7.      
  8. if (AjaxFileUpload1.HasAttributes)
  9.     {
  10.  
  11.         string fileName = Path.GetFileName(e.FileName);
  12.         string extension = Path.GetExtension(e.FileName);
  13.         AjaxFileUpload1.SaveAs(Server.MapPath("~/Wishlist/" + fileName));
  14.         String CS = ConfigurationManager.ConnectionStrings["BudgetDBConnectionString1"].ConnectionString;
  15.         using (SqlConnection con = new SqlConnection(CS))
  16.         {
  17.             SqlCommand cmd = new SqlCommand("insert into ImaginiWishlist(Nume,Extensie,DorintaId) values(@Nume,@Extensie,@DorinaId)", con);
  18.  
  19.  
  20.             SqlDataAdapter sda = new SqlDataAdapter();
  21.  
  22.             cmd.Parameters.AddWithValue("@Nume", fileName);
  23.             cmd.Parameters.AddWithValue("@Extensie", extension);
  24.  
  25.  
  26.            // cmd.Parameters.AddWithValue("@DorintaId", DorintaId);
  27.  
  28.             cmd.Connection = con;
  29.             con.Open();
  30.             cmd.ExecuteNonQuery();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top