Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. protected void btnRefrescar_Click(object sender, EventArgs e)
  2. {
  3. string fileLocation = ruta();
  4. Session["fileLocation"] = fileLocation;
  5.  
  6. if (fuImportarArchivo.HasFile)
  7. {
  8. btnRefrescar.Visible = false;
  9. lblArchivo.Visible = false;
  10. fuImportarArchivo.Visible = false;
  11.  
  12. }
  13.  
  14. }
  15.  
  16. [WebMethod]
  17. public static string Importar_Excel()
  18. {
  19. Transacciones t = new Transacciones();
  20. string dir_archivo = HttpContext.Current.Session["fileLocation"].ToString();
  21. DataTable dt = new DataTable();
  22. dt = ExcelToDataTable(dir_archivo);
  23. System.Web.HttpContext.Current.Session["dtExcel"] = dt;
  24. string datos = JsonConvert.SerializeObject(dt, Formatting.Indented);
  25. return datos;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement