title: How to get data from stored sql procedure in dataset with SqlDataAdapter?
body: <p>Is this good approach to get data from stored procedure? For example procedure is making <code>select * from base</code>. Here is my code but I need help with dataset and adapter:</p>
  
  <pre><code>public static DataSet Osvezi(string naziv_tablice)
  {
      SqlCommand cmd = null;
      DataSet dataset = null;
      SqlConnection konekcija = new SqlConnection(ConfigurationManager.AppSettings["skripta"]);
  
      if (konekcija != null)
      {
  
          try
          {
              if (konekcija.State == ConnectionState.Closed)
                  konekcija.Open();
  
              cmd = new SqlCommand();
              cmd.Connection = konekcija;
  
              cmd.CommandType = CommandType.StoredProcedure;
              cmd.CommandText = "Osvezi";
  
              cmd.Parameters.Add(new SqlParameter("@tablica", SqlDbType.Int)).Value = naziv_tablice;
              cmd.ExecuteNonQuery();
  
              SqlDataAdapter da = new SqlDataAdapter(cmd);
              // Fill the DataSet using default values for DataTable names, etc
              da.Fill(dataset);
  
              return dataset;
          }
  
          catch (Exception ee)
          {
              //Obravnava napak
  
          }
  
          finally
          {
              konekcija.Close();
              konekcija.Dispose();
              cmd.Dispose();
  
          }
  
          return dataset;
  
      }
      return dataset;
  
  }
  </code></pre>