Question : C# - Close and Dispose MySQL Connection

I am using the attached code to close a connection. My question is would I get anything different as an event if I were to use the dispose method? As I understand that close basically just severs the connection from the object while leaving memory resources still available for re-opening if needed, right? While Dispose removes all instances from memory?

So basically could I use dispose: OdbcCon.Dispose(); in the same way I used OdbcCon.Close(); without any issues?

Thanks
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
//// CLOSE
        public void MySqlDisconnection()
        {
            if (OdbcCon.State == ConnectionState.Open)
            {
                OdbcCon.Close();
            }
        }


        //// DISPOSE
        public void MySqlDisconnection()
        {
            if (OdbcCon.State == ConnectionState.Open)
            {
                OdbcCon.Close();
            }
        }

Answer : C# - Close and Dispose MySQL Connection

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
What if you change

while ($row = mysql_fetch_array($result)) {
      $reserved_dates[]=$row;
}

to

while ($row = mysql_fetch_array($result)) {
      $reserved_dates[]=$row[0];
}
Random Solutions  
 
programming4us programming4us