use \ before sting value where you want to insert single quote
i.e. string name = " ABC \'XYZ\'";
sample example
string connectionString;
connectionString = "Data Source=USER\\SQLEXPRESS;Initial Catalog=db;Integrated Security=SSPI;";
SqlConnection conn = new SqlConnection(connectionString);
conn.Open();
SqlCommand cmd = new SqlCommand("INSERT INTO [Employee]([Name],[EmployeeDepartment])VALUES (@Name,@EmployeeDepartment) ", conn);
cmd.CommandType = CommandType.Text;
cmd.Parameters.Add("@Name", SqlDbType.VarChar, 500).Value = "ABC \'XYZ\'";
cmd.Parameters.Add("@EmployeeDepartment", SqlDbType.VarChar, 50).Value = "Dept";
cmd.ExecuteNonQuery();
conn.Close();
SQL Query that you can fire from SSMS
INSERT INTO [Employee]
([Name]
,[EmployeeDepartment])
VALUES
('ABC ''XYZ'''
,'dept'
)