I have a method which takes a stored procedure name and a Microsoft.VisualBasic.Collection? I am referencing a vb project in which I have to pass in a collection to this method, but the current project I am in is in c#, so I am unclear what I can pass into the method?
Here is the vb call:
public void CallStoredProc(string spName, Microsoft.VisualBasic.Collection params);
In my c# app, I need to call this an pass in the appropriate c# object to params.
One option is to simply use the
Collectiontype directly from C#. This is a standard type in theMicrosoft.VisualBasic.dllassembly and can be used from any .Net language.The closest collection in the standard BCL though is
Hashtable. Converting betweenHashtableandCollectionshould be fairly straight forwardFor example
Note: This is not a direct mapping though. The
Collectiontype supports a number of operations whichHashtabledoes not like: before and after values, index by number or key, etc … My approach would be to use one type consistently throughout the application and change either the C# or VB project appropriately