title: Returning dataset values giving an error
body: <p>I have defined the following function which would return 3 columns from table.         </p>
  
  <pre><code>public DataSet GetFunc()
      {
          int iRet = 0;
          DataSet ds = new DataSet();
          SqlConnection sqlConnection = new SqlConnection();
          try
          {
              iRet = connect(ref sqlConnection);
              if (DB_SUCCESS_CONNECT == iRet)
              {
                  SqlCommand sqlCommand = new SqlCommand("", sqlConnection);                   
                  String strQuery = "Select ID, Did, FirstName from Users";
                  sqlCommand.CommandText = strQuery;
  
                  SqlDataAdapter adaptor = new SqlDataAdapter(sqlCommand);
                  adaptor.Fill(ds);
                  sqlConnection.Close();
                  return ds;                    
              }
  
          }
          catch (Exception e)
          {
              disconnect(ref sqlConnection);
          }
      }
  </code></pre>
  
  <p>But when I'm trying to build it, I'm getting the error:</p>
  
  <blockquote>
    <p>Error 172 'GetFunc()': not all code paths return a value</p>
  </blockquote>
  
  <p>I'm confused on where am I going wrong. Can someone guide me through?</p>