and here is my code
public partial class Form2 : Form
{
NpgsqlConnection conn;
NpgsqlCommand cmd;
string connstring = ConfigurationManager.ConnectionStrings["EmployeeData"].ConnectionString;
private DataSet ds = new DataSet();
private DataTable dt = new DataTable();
public Form2()
{
InitializeComponent();
lblErrorMessage.Visible = false;
}
string employee = "insert into VSP_Employee values ('" + txtEmpid.Text + "','" + txtEmpname.Text + "','" + txtEmailid.Text + "','" + txtphnum.Text + "','" + txtDOB.Text + "','" + txtDOJ.Text + "','" + txtNOD.Text + "','" + txtSalary.Text + "','" + txtLeavestaken.Text + "','" + txtLeavesBalance.Text + "')";
NpgsqlDataAdapter da = new NpgsqlDataAdapter(employee, conn);
cmd = new NpgsqlCommand(employee, conn);
da = new NpgsqlDataAdapter(cmd);
ds = new DataSet();
da.Fill(ds);