Hey!
Have you tried to add the fields together with the '+' operator?
SqlCommand comm.Parameters.AddWithValue("@emailadd", TextBox1.Text + TextBox2.Text + TextBox3.Text);
The code above will work! However, there's a neater way. If you want to modify strings, Microsoft recommends using the
StringBuilder
which will handle string operations way faster. Consider the code below for example :
StringBuilder phoneNumber = new StringBuilder();
phoneNumber.Append("(");
phoneNumber.Append(textBox1.Text);
phoneNumber.Append(") ");
phoneNumber.Append(textBox2.Text);
phoneNumber.Append(" ");
phoneNumber.Append(textBox3.Text);
SqlCommand comm.Parameters.AddWithValue("@emailadd", phoneNumber.ToString());
And then a final quick note : Please notice you're using the
@emailadd
parameter to insert a phone number, this may be a typo?
Good luck!
Eduard