Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot add a reference to c# code
    primarykey
    data
    text
    <p><strong>My setup - .NET 3.5 and Visual Studio 2008.</strong> I have c# code (inside ssis, but don't worry about ssis). I wanted to be able to use ADODB in my code. So, I added a reference to ADODB. I selected Microsoft ActiveX Data Objects 2.8 Library from the COM tab. Then, I added using ADODB as my import. </p> <p>The sample steps are here - </p> <p><a href="http://www.c-sharpcorner.com/uploadfile/ptailor/adodbservice12062005002501am/adodbservice.aspx" rel="nofollow">http://www.c-sharpcorner.com/uploadfile/ptailor/adodbservice12062005002501am/adodbservice.aspx</a></p> <p>But, after running the project, I get an error and I also see that the reference is missing form the list of references. I swear it was there after I added it. How do I fix this problem ?</p> <p>error-</p> <pre><code>System.IO.FileNotFoundException: Could not load file or assembly 'Interop.ADODB, Version=2.8.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. File name: 'Interop.ADODB, Version=2.8.0.0, Culture=neutral, PublicKeyToken=null' at ST_39348fjejencuw92092828303554.csproj.ScriptMain.Main() WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct&amp; sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript() </code></pre> <p>Need for this question -</p> <p>I was trying to use the code below to get number of rows in an ADO recordset. When I tried to use the code, i kept getting the error "the type or namespace name 'ADODB' could not be found". </p> <pre><code>ADODB.Recordset result = (ADODB.Recordset)Dts.Variables["RESULT_SET"].Value; int rowCount = result.RecordCount; MessageBox.Show("rowCount = " + rowCount); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload