title: Void method in class c#
body: <p>I have a problem with calling a method void for a string.</p>
  
  <p>I've created a class:</p>
  
  <pre><code>    public string SendData(string val1){ return val1; }
  
      public void RecoverBirth()
      {
          clsConnectionClass conn = new clsConnectionClass();
          SqlCommand cmd = new SqlCommand();
          SqlDataReader dr;
          cmd.CommandText = "select * from birthday";
          dr = cmd.ExecuteReader();
          if (dr.HasRows)
          {
              while (dr.Read())
              {
                  SendData(dr[1].ToString() + " " + dr[2].ToString() + "\r\n");
              }
          }
      }
  }
  </code></pre>
  
  <p>And then I try to retrieve the data from the class</p>
  
  <pre><code>private void button_Click(object sender, EventArgs e)
  {
      var _test = new Test();
      string Result = _test.RecoverBirth();
  }
  </code></pre>
  
  <p>This error occurs: </p>
  
  <blockquote>
    <p>Can't convert method "void" to "string"</p>
  </blockquote>
  
  <p>I need RecoverBirth method to be Void not "string", because it has a lot of different cycle and not everything return something, and if I declare it as string I have to use a lot of return null. </p>
  
  <p>Is there a (better) way to do this?</p>