public void Put([FromBody] MainLOLICH value) { SqlConnection conn = new SqlConnection( "Data Source=sql2.aksenov.in;user=out_east;Initial Catalog=minaev;password=gisiperu;"); conn.Open(); string sql = $@"INSERT INTO Anek (anek) values(N'{value.anek}')"; SqlCommand command = new SqlCommand(sql, conn); command.ExecuteNonQuery(); conn.Close(); }
public void Post([FromBody] MainLOLICH value) { SqlConnection conn = new SqlConnection( "Data Source=sql2.aksenov.in;user=out_east;Initial Catalog=minaev;password=gisiperu;"); conn.Open(); string sql = $@"Update anek set Anek = N'{value.anek}' where Id = {value.id}"; SqlCommand command = new SqlCommand(sql, conn); command.ExecuteNonQuery(); conn.Close(); //string l = value.anek; //int w = value.id; }