I have a function that returns a datareader but I am afraid the connection is not getting closed properly. Does anyone have any ideas on the best way to do this?<BR><BR>my sample code<BR><BR>Dim dsn As String = ConfigurationSettings.AppSettings("dsn")<BR>Dim conn As SqlConnection<BR>Dim myCmd As SqlCommand<BR>dim sql As String<BR><BR>conn = New SqlConnection(dsn)<BR>conn.Open()<BR>sql="select statement here"<BR><BR>myCmd = New SqlCommand(sql, conn)<BR>myCmd.Dispose()<BR>return myCmd.ExecuteReader(CommandBehavior.CloseConnectio n)<BR><BR>everythings works properly I am just trying to have the most efficient code possible.<BR><BR>Thanks<BR><BR><BR><BR>