Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best place for answers
Message
From
18/07/2007 05:09:01
 
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01241244
Message ID:
01241404
Views:
30
>Hi, John,
>
>I see some of your prior .NET posts, and at least one of them it seems like you might have found the answer yourself.
>
>Can you repost the questions (or supply the message ID) for any where you're still looking for an answer?
>
>Kevin

Hi Kevin,

On the how to access the DataSet fields from the DataGridView CellFormat event, I think I have it. I'm using:
[psuedo code]
private void OnCellFormat(object sender, DataGridViewCellFormattingEventArgs e)
  {
  type value = DataSet.Table[e.RowIndex].FieldName;
  }
Seems to work, but I'm not sure if that is going to be a problem if the grid gets sorted. Haven't tested that yet.

The other question was on whether to consider outlook objects to be managed or unmanaged in a Dispose event.

I pasted the full code at the time, which might have been the reason for no response, here's the relevant snippets.
    private bool                IsDisposed = false;
    public  Outlook.Application oApp;
    public  Outlook.NameSpace   oNS;
    public  Outlook.MAPIFolder  oInbox;
    public  Outlook.Items       oItems;
    public  Outlook.MailItem    oMsg;
    public void Dispose()
      {
      Dispose(true);
      GC.SuppressFinalize(this);
      }

    /// Internal Destructor Code
    protected void Dispose(bool Disposing)
      {
      if(!IsDisposed)
        {
        if(Disposing)
          {
          // */* Clean up managed resources
          }
        // */* Clean up unmanaged resources
        //Log off.
        oNS.Logoff();
        //Explicitly release objects.
        oMsg = null;
        oItems = null;
        oInbox = null;
        oNS = null;
        oApp = null;
        }
       IsDisposed=true;
       }

    /// Destructor
    ~cdsOutlook()
      {
      Dispose(false);
      }
    }
I have them as unmanaged at the moment, but I think they are actually managed?

I didn't see the harm in nulling them here so I left it the way it is. I probably should test oNS for null before the oNS.Logoff()

Thanks
Previous
Reply
Map
View

Click here to load this message in the networking platform