SqlConnection cnn = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
SqlCommand cmd = new SqlCommand();
cmd.Connection = cnn;
cnn.Open();
cmd.CommandText = "INSERT INTO other_usage(patientid,other_id,numberz) Select P.id,3,1 FROM patients P WHERE P.sex = 'زن' AND P.age >= 50";
cmd.ExecuteNonQuery();
cnn.Close();




شما اینجوری فرضش کنم . !! . اون 2 خط اول رو قسمت partial تعریف کردم