Tuesday, February 22, 2011

Convert String to ObjectId

A comment I added to the Through the Interface Blog, in case something happened to it there.

Kean, how about a post on the new way of getting an ObjectId from a string using the IntPtr?

Well if you don't, here's a bit of code for those looking how to do it:

Dim objIdPtr as IntPtr
objIdPtr = New IntPtr(CType(id, Integer)
Dim ObjId as New ObjectId(ObjIdPtr)

Your post seems to be the only relevant one that comes up in a Google search, thought I'd add it here so I can find it the next time I looked.


No comments:


Blog Widget by LinkWithin