You say that PC2 has SQL Server Management Studio. But do you have SQL Server installed on the machine? SSMS is not SQL Server. It is just a tool that permits you to talk to SQL Server.
While unrelated to your question, I like to point out that this is very wrong:
cmd = new SqlCommand("Insert into CandidateInformation values('" + txt_name.Text + "', '" + txt_address.Text + "', '" + txt_tele1.Text + "', '" + txt_tele2.Text + "', '" + txt_nic.Text + "', '" + txt_mail.Text+ "','" + gender + "' , '" + ch1 + "', '" + ch2 + "', '" + ch3 + "')", con);
This should be:
cmd.CommantText =@ "Insert into CandidateInformation (col1, col2, col3, ...) VALUES(@name, @address, ...) cmd.Parameters.Add("@name", SqlDbType.NVarchar, 30).Value = txt_name; cmd.Parameters.Add("@address", SqlDbType.NVarChar, 50).Value = txt_address; ...
Building a string of input values comes with a lot of problems:
- It is difficult to get write and to read.
- Open for SQL injection.
- It prevents SQL Server from caching an execution plan and can cause performance issues.
Using parameterised commands is the way you must use. The actual data type depends on the column. The numbers 30, 50, in the example is the length of the target columns.