Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Data.SqlClient;
- using System.Windows.Forms;
- namespace ControlVacunasDAL
- {
- public class Indicaciones
- {
- public int Id { get; set; }
- public string sexo_aplica { get; set; }
- public string Precauciones { get; set; }
- public string contraindicaciones { get; set; }
- public void Save()
- {
- var connection = new DBConnection().getConnection();
- string sql = $"INSERT INTO Mstr_Indicaciones (Ind_sexo_aplica,Ind_Precauciones, ind_contraindicaciones) VALUES ('{sexo_aplica}', '{Precauciones}', '{contraindicaciones}') ;";
- SqlCommand command;
- try
- {
- connection.Open();
- command = new SqlCommand(sql, connection);
- command.ExecuteNonQuery();
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement