postgresql 9.3 - I can't insert data from text boxes into postgre sql table using C# -
and here 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 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);
Comments
Post a Comment