Hi (just joined today!!!)
System.Data.SqlClient.SqlConnection cn = new System.Data.SqlClient.SqlConnection(strConnectStri ng);
System.Data.SqlClient.SqlCommand cmd = cn.CreateCommand();
cmd.CommandText = "Insert into Clients(ClientID,Name,Surname,IDNo,PostalAddress,R esidentialAddress,
HomeTel," +
"Mobile,Remarks,BankName,BranchName,BranchCode,Acc ountNumber,
CardNumber," +
"ExpDate,PIN,TypeAccount,EmpNumber,Department,PayD ate,NettSal,EmployersID,UserID,Borrowing_Limit,Bla ckList)" +
"values('" + txtClientNum.Text + "','" + txtCustName.Text + "','"
+ txtSurname.Text + "','" + txtCustID.Text + "','" + txtPostal.Text + "','"
+ txtResid.Text + "','" + txtMobile.Text + "','"
+ txtHomeTel.Text + "','" + txtRemarks.Text + "','"
+ txtBankName.Text + "','" + txtBranch.Text + "','"
+ txtBranchCode.Text + "','" + txtAccNum.Text + "','"
+ txtCardNum.Text + "','" + txtExpDate.Text + "','"
+ txtPIN.Text + "','" + cbAccTypes.Text + "','"
+ txtEmpNum.Text + "','" + txtDept.Text + "','"
+ cbPayDate.Text + "','" + txtNettSal.Text + "','"
+ lblEmpID.Text + "','" + lblUsID.Text + "','" + txtBorrowLimit.Text + "','" + blacklist + "')";
cmd.CommandType = System.Data.CommandType.Text;
cn.Open();
cmd.ExecuteNonQuery();
cn.Close();
This should work. The plus signs are for concatenation purposes.
This is the actual query that I use and it works everytime
jan
dude_in_africa
|