Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I doubt the JET OLEDB has out of the box support for connecting to databases based on an embedded resources. I see two options to work around this:</p> <p><strong>1. extract the resource</strong></p> <p>In your test's <a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.unittesting.classinitializeattribute%28VS.80%29.aspx" rel="nofollow noreferrer">ClassInitialize</a>, you could <a href="http://www.csharper.net/blog/getting_an_embedded_resource_file_out_of_an_assembly.aspx" rel="nofollow noreferrer">extract the assembly resource</a> to a known location. Refer to this known location in your JET connection string. Clean up the extracted file again in your test's <a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.unittesting.classcleanupattribute%28VS.80%29.aspx" rel="nofollow noreferrer">ClassCleanup</a>.</p> <p><strong>2. write your own data source</strong></p> <p>You <em>might</em> be able to write your own <a href="http://msdn.microsoft.com/en-us/library/system.data.common.dbproviderfactory.aspx" rel="nofollow noreferrer">DbProviderFactory</a> which supports accessing embedded excel files. To make such a factory discoverable for mstest, you'll have to <a href="http://social.msdn.microsoft.com/Forums/en/adodotnetdataproviders/thread/91d9337a-ade1-4a53-966b-a540c784b7e6" rel="nofollow noreferrer">register your factory</a> with <a href="http://msdn.microsoft.com/en-us/library/system.data.common.dbproviderfactories.aspx" rel="nofollow noreferrer">DbProviderFactories</a>.</p> <p>To see how mstest handles data sources internally, open up the <code>Microsoft.VisualStudio.QualityTools.Common.dll</code> assembly with <a href="http://www.red-gate.com/products/reflector/" rel="nofollow noreferrer">reflector</a> and start following the trail by dissassembling <code>Microsoft.VisualStudio.TestTools.Utility.TestDataConnection.Create</code>.</p>
    singulars
    1. This table or related slice is empty.
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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