No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Re:
im a beginner in C sharp. im stuck with the following. i hope someone can get me on the track again. i want to add a validation for user input such as making sure the year of the yearTextBox is not greater than the current year +2. [CODE]private void yearTextBox_Validating(object … |
|
[code]SqlConnection con = new SqlConnection(connectionstring); SqlCommand cmd = new SqlCommand("proAdd", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter sqlparam = null; sqlparam = cmd.Parameters.Add("@EmpName", SqlDbType.VarChar, 50); sqlparam.Value = txtname.Text.ToString(); sqlparam = cmd.Parameters.Add("@Address", SqlDbType.VarChar, 50); sqlparam.Value = txtaddress.Text.ToString(); sqlparam = cmd.Parameters.Add("@BasicPay", SqlDbType.Money); sqlparam.Value = decimal.Parse(txtaddress.Text); sqlparam = cmd.Parameters.Add("@PF", SqlDbType.Money); sqlparam.Value =decimal.Parse(txtpf.Text); sqlparam = cmd.Parameters.Add("@HRA", … |