title: Struggling with SqlCommands Queries Baffle me
body: <p>I'm struggling hard at making a testing program for my database.</p>
  
  <p>My database connection works and everything I just can't seem to get the queries to work. And I have no idea on how to view the results in maybe a listbox or something.</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>public static string Query1()
  {
      List&lt;string[]&gt; returnvalue = new List&lt;string[]&gt;();
  
      if (DatabaseConnection.OpenConnection())
      {
          try
          {              
              DatabaseConnection.OpenConnection();
  
              SqlCommand cmd = new SqlCommand("SELECT * FROM UniqueWeapon U, Weapon W WHERE W.WeaponID = U.WeaponIDFK AND U.AllyIDFK IS NOT NULL AND W.Damage &gt; 10 AND W.WeaponType = 'Spell';", DatabaseConnection.connect);
              cmd.Connection = DatabaseConnection.connect;
  
              SqlDataAdapter dap = new SqlDataAdapter(cmd);
  
              DataTable tbl = new DataTable();
              dap.Fill(tbl);
  
              //cmd.CommandText = "SELECT * FROM UniqueWeapon U, Weapon W WHERE W.WeaponID = U.WeaponIDFK AND U.AllyIDFK IS NOT NULL AND W.Damage &gt; 10 AND W.WeaponType = 'Spell';";
              //cmd.ExecuteNonQuery();             
  
              SqlDataReader reader = cmd.ExecuteReader();
  
              while (reader.Read())
              {
                  dap.Fill(tbl);
              }
          }
          catch (SqlException e)
          {
              Console.WriteLine("Query Failed: " + e.StackTrace + e.Message.ToString());
              return "returnvalue";
          }
          finally
          {
              DatabaseConnection.CloseConnection();
          }
      }
  
      return "returnvalue";
  }
  </code></pre>
  
  <p>Any feedback or help would be sick!</p>
  
  <p>Thanks!</p>