.net

There are 4 entries for the tag .net

Create an ADODB Recordset in code from XML

Recently I have been doing some work on an older system using ADODB recordsets. Every now and then we still have to support these old systems. I wanted to create an open recordset in code on the .NET side to pass to the older system, but ADODB really wants an open database connection in order to open a recordset. My first obvious attempt was to create the recordset object, then create the field objects and add them to the recordset. I could create the recordset this way, but I couldn't open it, and...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

SharePoint Adventures - Reading an Excel Spreadsheet From A Stream

When I needed to read an Excel spreadsheet from a SharePoint site, it seemed like a simple enough request. Previously, whenever I needed to open an Excel file, I used an OleDb connection with the following connection string: string connectionString = @"Provider=Microsoft.ACE.OL... Data Source={0};Persist Security Info=False; Extended Properties=""Excel 12.0;HDR=YES"""; connectionString = string.Format(connectionStr... filePath); Of course, you can't open the file from the SharePoint site this...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

InternalsVisibleTo with Strongly-Type Assemblies

For testing, I often use the InternalsVisibleTo for my unit tests. It looks like this: [assembly: InternalsVisibleTo("MyProje... When the assembly is strongly typed, though, this simple statement will not work, and we get the following message: Error: "Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations" To fix this, you must do two things: You must sign the test assembly, and you must include the public key in the InternalsVisibleTo statement....
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

LINQ to SQL with ReSharper

I am hooked on ReSharper, and when I started using VS 2008 with ReSharper, I was feeling the pain with version 3.1. I would go back and forth between turning it off so I could access my Linq methods and avoid having ReSharper reformat my code into a nice mess, and turning it on so I could have it fix my usings and reformat my code nicely. I have been using ReSharper 4.0 pre-release version for a few weeks now, and it's working out pretty good. I only have to turn it off once in a while now. The lambda...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati