Guest User

Untitled

a guest
Oct 18th, 2017
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. <connectionStrings>
  2. <add name="SicConnectionString" connectionString ="Data Source=ETID-012312\ETID012312;User=sa;Password=admin2312;Initial Catalog=Sic_db;Integrated Security=True;" providerName = "System.Data.SqlClient" />
  3.  
  4. @{
  5. Layout = "~/_SiteLayout.cshtml";
  6. Page.Title = "Cadastro";
  7.  
  8. var fantasia = "";
  9. var cnpj = "";
  10. var cep = "";
  11. var endereco = "";
  12. var estado = "";
  13. var cidade = "";
  14. var bairro = "";
  15. var celular = "";
  16. var telefone = "";
  17. var email = "";
  18. var usuario = "";
  19. var senha = "";
  20. var csenha = "";
  21. var error = false;
  22. var resultado = "";
  23.  
  24. if (IsPost)
  25. {
  26. var db = Database.OpenConnectionString("Data Source=;User=;Password=;Initial Catalog=;Integrated Security=True;");
  27. fantasia = Request.Form["fantasia_txv"];
  28. cnpj = Request.Form["cnpj_txv"];
  29. cep = Request.Form["cep_txv"];
  30. endereco = Request.Form["endereco_txv"];
  31. estado = Request.Form["estado_txv"];
  32. cidade = Request.Form["cidade_txv"];
  33. bairro = Request.Form["bairro_txv"];
  34. celular = Request.Form["celular_txv"];
  35. telefone = Request.Form["telefone_txv"];
  36. email = Request.Form["email_txv"];
  37. usuario = Request.Form["usuario_txv"];
  38. senha = Request.Form["senha_txv"];
  39. csenha = Request.Form["csenha_txv"];
  40.  
  41. // Define the insert query. The values to assign to the
  42. // columns in the Product table are defined as parameters
  43. // with the VALUES keyword.
  44.  
  45. var insertQuery = "INSERT INTO dbo.TempAcc (TA_fantasia, TA_cnpj, TA_cep, TA_endereco, TA_estado, TA_cidade, TA_bairro, TA_celular, TA_telefone, TA_email, TA_usuario, TA_senha)" +
  46. "VALUES (@0, @1, @2, @3, @4, @5, @6, @7, @8, @9, @10, @11)";
  47. db.Execute(insertQuery, fantasia, cnpj, cep, endereco, estado, cidade, bairro, celular, telefone, email, usuario, senha);
  48. // Display the page that lists products.
  49.  
  50. }
Add Comment
Please, Sign In to add comment