S
Sanjay Tibrewal
Hello there,
I have some code in a VB library dll whose signature is as
// VB private library code
Public Sub ExecuteNonQuery(ByVal sConn As String, _
ByRef oCmd As SqlClient.SqlCommand)
I create another project in C# and include the library locally. I use the
following code to
call the function in VB library
// C# code
string m_sConn;
SqlCommand oCmd2 = new SqlCommand();
m_oDac.ExecuteNonQuery(m_sConn, oCmd2);
When I compile the above code I get the following error. Why can't an object
passed in to the function in C# be converted to a ref object in VB.Net dll?
C:\Office\Test\WebDAVTest\Class1.cs(516): Argument '2': cannot convert from
'System.Data.SqlClient.SqlCommand' to 'ref System.Data.SqlClient.SqlCommand'
Thanks for your help.
Sanjay.
I have some code in a VB library dll whose signature is as
// VB private library code
Public Sub ExecuteNonQuery(ByVal sConn As String, _
ByRef oCmd As SqlClient.SqlCommand)
I create another project in C# and include the library locally. I use the
following code to
call the function in VB library
// C# code
string m_sConn;
SqlCommand oCmd2 = new SqlCommand();
m_oDac.ExecuteNonQuery(m_sConn, oCmd2);
When I compile the above code I get the following error. Why can't an object
passed in to the function in C# be converted to a ref object in VB.Net dll?
C:\Office\Test\WebDAVTest\Class1.cs(516): Argument '2': cannot convert from
'System.Data.SqlClient.SqlCommand' to 'ref System.Data.SqlClient.SqlCommand'
Thanks for your help.
Sanjay.