# Wednesday, July 29, 2009

Windows 7 performs better than WindowsXP

Just came across an interesting article from GCN (Government Computer News), quote:

“It’s a victory that performance didn’t drop from XP, which we still consider one of the best operating systems out there. The fact that Windows 7 increased performance slightly across the board is pretty amazing…”

Read the full item here: http://gcn.com/Articles/2009/07/27/GCN-Lab-Windows-7-Performance-Tests.aspx

#    Comments [1] |

New Ergo keyboard

I received a door prize at last night’s BAND meeting: a Microsoft Natural Ergo Keyboard 4000.
I’ve got still got to get used to a little bit, but it feels good already :-)

#    Comments [1] |

Gartner predicts growth in software spending for 2010

After all the misery around the financial crisis is nice to see that Gartner is expecting a turnaround in 2010. Read more here: http://www.gartner.com/it/page.jsp?id=1096812.

#    Comments [0] |
# Monday, July 27, 2009

MDN - Augusta Developer Event, 27th of August 2009.

The MDN meeting on the 27th of August, 2009 will be an INETA sponsored event. INETA will make arrangements for Kathleen Dollard to be able to speak to our group. Kathleen is a great speaker and authority on the subject of code generation and software composability. We're very happy and lucky to have her come up and present two sessions at our meeting. A third session, also on code generation will be done by Mark Blomsma.

We'll start the meeting with free pizza at 12pm. With the first session starting at 12:30pm. We aim to finish around 5pm.

Code Generation
by Kathleen Dollard
Code generation is undergoing a renaissance as Microsoft jumps into the picture and converges with our increasing understanding of code generation. You’ll learn core code generation principles that transcend all code generation tools. Building on this you’ll get a dip into template languages seeing both T4 which is part of Visual Studio and VB9 XML literal templates in order to understand the strength of each approach. Once you understand how templates work, you’ll dive into metadata – the part of the system that uniquely describes the specific application your building. You’ll see two approaches to protecting handcrafted code on the .NET platform. And you’ll see how to hook generation into your development process. The overall process of application generation has not matured and is rapidly changing – this talk doesn’t promise silver bullets. Instead you’ll leave with a good understanding of the latest code generation techniques and how you can fit them into your unique development environment.

Introduction to Visual Studio T4
by Mark Blomsma
An introduction to a somewhat hidden feature in Visual Studio: Text Template Transformation Toolkit or T4 for short. You will learn about using T4 and the statement, expressions and declarations needed to succesfully use T4 in your software projects.

Composable Applications with MEF
by Kathleen Dollard
Decoupling portions of your application has tremendous payback during both development and maintenance. Your application becomes more testable and flexible and can more easily evolve to meet changing demands. Decoupling your application also allows a new level of partnership with external groups because you can safely incorporate their code in your application without recompiling or releasing source code – effectively creating ecosystems supported by your application. Over the years Microsoft has released several different provider models in different areas of the framework, libraries, and supporting tools. This year several teams at Microsoft moved toward consolidating these efforts with the Managed Extensibility Framework, or MEF. This tool differs from an IoC (Inversion of Control) container because focuses directly at application composability, extensibility, and discover. MEF supports Microsoft efforts like Visual Studio 2010, but it can also play a role in your current applications.

Kathleen Dollard is a consultant, author, trainer, and speaker. She’s been a Microsoft MVP for over ten years and has spoken about .NET in 28 states and 5 countries. She’s written dozens of articles including the “Ask Kathleen” column in Visual Studio Magazine. She also wrote “Code Generation in Microsoft .NET” (Apress). Her passion is helping programmers be smarter in how they develop by learning to better use .NET languages, libraries and platforms. She works with WPF, WF, as well as core technologies including System.AddIn. She’s currently creating template infrastructure for code generation using VB XML literals. After working on the problem of capturing business intent in metadata and test definitions for years, she’s working with industry improvements in these areas. She’s also working on full life cycle improvements, such as unit testing, better debugging and static analysis (FxCop). When not working, she enjoys woodworking, snowshoeing, and kayaking depending on the outdoor temperature.

Mark Blomsma is a consultant, author, trainer and speaker. He's been a Microsoft MVP for 6 years and has spoken at our meeting many time. He runs a consulting business up in Lincoln, ME.

Location
The event will be held at:
State of Maine Offices
Harlow Building
First floor conference room
18 Elkins Ave
Augusta

RSVP
Please register so we can accommodate accordingly and make sure we have enough pizza.
Register here: http://www.maine-devnet.org/Home/SignUpForEvent.aspx

#    Comments [1] |
# Thursday, July 23, 2009

DevelopMentor RSS Feed

I believe the URL has changed, so just in case you lost it… Keep track of blog posts from all the DevelopMentor instructors by subscribing to: http://browse.develop.com/bmsfeed/developmentor http://feeds.feedburner.com/DevelopmentorInstructors

Updated 08-19-2009: Feed is now available at: http://feeds.feedburner.com/DevelopmentorInstructors

#    Comments [0] |

Next Bangor Area .NET Developers (BAND) meeting is 07/28

Next Gig: Tuesday 07/28/2009 6:00 pm - 8:30 pm
Topic: Using Test-Driven Development to Get Done Fast
Presenter: Scott Bressette
Room: Kominsky Auditorium, Husson University, Bangor

Scott walks us through a real life situation to show how using Test-Driven Development gets the code done right the first time. He’ll discuss how understanding Agile concepts such as roles and motives will help you read “between the lines” of what clients are asking for and deliver what they really want. TDD can seem like an impediment to getting things done quickly, but Scott will show how he uses just a few simple techniques to code with both speed and confidence.
Scott is the Director of Development at Occupational Health Research in Skowhegan.

Register at http://www.bangordevelopers.com

#    Comments [0] |

Blog updated to dasBlog 2.3.9074.18820

I’ve just updated my blog to the latest version of dasBlog and enabled comments again. I picked a new theme (Mads Simple) to freshen things up a little and modified the theme to include a new service offered by DevelopMentor which allows you to browse my blog and that of my fellow DevelopMentor instructors in a great way. Check it out for yourself.

#    Comments [1] |

Windows 7 RTM

Just got this in the mail:
As you know, Microsoft® Windows 7 was Released to Manufacturing (RTM) this afternoon, July 22, 2009. We are excited to be releasing what we consider our best OS to date and we couldn’t have done it without you, our Technical Beta Testers!
With the announcement of RTM, the beta program is officially closed.

Time to get ready and move my customers to Windows 7 :-)

More on availability here: http://windowsteamblog.com/blogs/windows7/archive/2009/07/22/windows-7-has-been-released-to-manufacturing.aspx and http://windowsteamblog.com/blogs/windows7/archive/2009/07/21/when-will-you-get-windows-7-rtm.aspx

Countdown to August 6th has started!

#    Comments [0] |
# Monday, July 20, 2009

ReportViewer in VS2010

I’ve been using the ReportViewer control in Visual Studio quite a bit to create RDLC (offline) reports that are based on the result of LINQ queries against object trees. It’s been a while since there has been a new release of this control and Visual Studio 2010 did not include anything major with regards to the ReportViewer control. I asked around and got an email from Robert Bruckner answering my two main questions:

1. Yes, the ReportViewer control in VS2010 will run on both .NET 3.5 as well as .NET 4.0.
2. Yes, the ReportViewer control in VS2010 will support Export to Word for RDLC (offline) scenarios.

Thanks Robert (and the rest of the people working on this technology), great news!

#    Comments [8] |
# Tuesday, July 14, 2009

Urban Legends

I frequently receive emails in my inbox warning me about all sorts of scandals or terrible things that could happen to my health. Usually the person(s) forwarding these mails to me have my best interests at heart. Most of the time the emails are a hoax. I found a good site to check and see whether something is a hoax or not: http://urbanlegends.about.com/

#    Comments [1] |

Patience while waiting for Windows 7

I was hoping to be able to download the RTM version of Windows 7 yesterday, but it looks like I’ll need to be patient a little longer. Brandon LeBlanc explains the RTM process here in a very clear blog post.

I’ve copied the section on how to get it:

Once Windows 7 is complete, how do I get it?


The answer depends on who you are:

  • MSDN & TechNet Subscribers: Subscribers will be able to download the final version of Windows 7 a few weeks after we announce RTM.
  • Volume License (VL) Customers: As announced today by Bill Veghte during his WPC09 keynote, Windows 7 will be available to Volume License customers on September 1st.
  • Consumers, Enthusiasts, & Beta Testers (Everyone else): The retail version of Windows 7 will be available in stores October 22nd. If you pre-ordered Windows 7, it should be delivered sometime around the October 22nd timeframe (depends on the retailer). You can pre-order Windows 7 today through many online retailers like the Microsoft Store.
  • On New PCs: OEMs are expected to start shipping new PCs with Windows 7 pre-installed on them around October 22nd.
#    Comments [0] |
# Monday, June 29, 2009

Why try new technologies?

I just read this post by Paul Gielens (http://weblogs.asp.net/pgielens/archive/2009/05/06/why-asp-net-mvc.aspx) about why a group of developers decided to use ASP.NET MVC.

The answer to the question “what made you guys decide to use MVC for this applications” was interesting “because we wanted to learn something new, and because it’s cool!”.

So the feedback on this post ranges from “ahumpff” to “these guys should not be experimenting when someone else is footing the bill”.

I’d just like to pitch in:

a) It’s great to see people showing interest in new technologies. I’d rather have some folks on my team who are eager to dive into a new technology than those who shy away from anything new.
b) There is not a lot of additional info: but assuming that the project was not a multi-million dollar project and there was some room for a little risk. Then “why not?”. In my experience you can play with any technology, but you won’t truly learn it until you have a serious goal. Without a fixed goal you won’t find the pain points of the technology.
c) I believe in risk driven project management. I’m not sure whether it is an official approach to project management. But I like to list all known risks, then decide whether something needs to be done to mitigate the risk. If the cost of mitigation outweighs the risk, then agree to do nothing. In essence, just about everything in PM is about risk management. Anyway, back to the new technology: do an assessment: will this new technology cost me more time to develop this app? Yes/no? No, then use it. Yes? How much? Can we afford to spend X hours on learning? Will it make my team happy? Happy coders write more code… aw heck, let them use it :-).

#    Comments [0] |
# Wednesday, June 24, 2009

Windows 7

Just ran across the boxes they will be using to ship Windows 7 (available Oct. 22, 2009):

Windows 7 Home PremiumWindows 7 ProfessionalWindows 7 Ultimate

From Bink.nu:
Microsoft has now set July 13th for RTM “sign-off”.

Sign off is the process where all divisions sign that they agree on the final code, which means the actual RTM build will be created a few days earlier, which is targeted on July 10th.


The general availability (GA) is set to October 22nd, this is when you can buy it in stores in a box or on new PC’s (OEM).

We can expect the RTM much earlier on MSDN, Technet and Volume Licensing download sites, probably a few days after July 13th.

#    Comments [0] |
# Wednesday, June 10, 2009

Daniel Pratt to present at BAND meeting

Daniel will present at the next Bangor Area .NET Developer (BAND) meeting (June 23rd, 2009):

WPF - A little further down the rabbit hole

Probably most of us have seen at least one slick demo of WPF or Silverlight. Such demos are inspiring, but they don't convey what it's like to actually use WPF in the real world. Fresh from completing our first business-centric application that uses WPF extensively, I'm excited to share from my experience of using WPF in the real world.

 

Daniel is a developer for Tyler Technologies in Bangor.

 

More information on: www.bangordevelopers.com

 

More from Daniel: http://www.danielgpratt.com/

#    Comments [0] |

Only one week to go to the AUGUSTA (Maine) MSDN Northeast Roadshow

Only one week to go! The MSDN Northeast Roadshow will once again make a stop in Augusta, ME. If you haven’t done so already, then sign up now!

 

June 18th is the day you can enjoy a day of free learning with Microsoft's New England Dream Team: Chris, Bob & Jim.

 

More info and sign up info: http://tinyurl.com/Summer09Roadshow.

#    Comments [0] |
# Monday, June 08, 2009

Windows 7 and Virtual PC + XP experience

If you’re planning to use Virtual PC or make use of the XP backwards compatibility mode in Windows 7, then you’ll need to have a CPU that supports hardware virtualization. Sadly is not very clear which CPU’s offer that feature.

I found two pages with useful info, one for Intel processors and one for AMD:

Note: for XP virtualization you will also need a minimum of 2GB of RAM.

I’ve copied the essential information (including the disclaimer) for your reference pleasure :-)

Disclaimer: I believe this information is accurate, but it is possible that some mistakes may be present in the following tables. caused by inaccuracies in Intel’s documentation or by editing and composition errors. I urge you to do your own research before making any buying decisions. Even if a specific CPU appears to support Intel VT, make sure that the PC’s BIOS manufacturer allows this feature to be enabled.

Intel Desktop CPUs

Core 2 Duo  
E4300/4400/4500/4600/4700 NO
E6300/6320/6400/6420/6540/6550 YES
E6600/6700/6750/6850 YES
E7200/7300/7400/7500 NO
E8190 NO
E8200/8300/8400/8500/8600 YES
Core 2 Extreme  
QX6700/6800/6850 YES
QX9650/9770/9775 YES
X6800 YES
Core 2 Quad  
Q6600/6700 YES
Q8200/8200S/8300/8400/8400S NO
Q9300/9400/9400S YES
Q9450/9550/9550S/9650 YES
Core i7/Core i7 Extreme  
I7-920/940 YES
I7-965 YES
Pentium D/Pentium EE  
805/820/830/840 NO
915/925/935/945 NO
920/930/940/950/960 YES
955/965 YES
Pentium for Desktop  
E2140/2160/2180/2200/2220 NO
E5200/5300/5400 NO

Intel Mobile CPUs

Core 2 Duo Mobile  
L7200/7300/7400/7500 YES
P7350/7450 NO
P7370 YES
P8400/8600/8700/9500/9600 YES
SL9300/9400/9600 YES
SP9300/9400/9600 YES
SU9300/9400/9600 YES
T5200/5250/5270/5300/5450/5470 NO
T5500/5600 YES
T5550/5670/5750/5800/5850/5870/5900 NO
T6400/6570 NO
T7100/7200/7250/7300/7400 YES
T7500/7600/7700/7800 YES
T8100/8300 YES
T9300/9400/9500/9550/9600/9800 YES
U7500/U7600 YES
Core 2 Extreme Mobile  
QX9300 YES
X7800/7900 YES
X9000/9100 YES
Core 2 Quad Mobile  
Q9000 YES
Q9100 NO
Core 2 Solo  
SU3300/3500 YES
U2100/2200 YES
Core Duo  
L2300/2400/2500 YES
T2050/2250 NO
T2300/2400/2500/2600/2700 YES
T2300E/2350/2450 NO
U2400/2500 YES
Core Solo  
T1300/1400 YES
T1350 NO
U1300/1400/1500 YES

 

AMD CPUs

“With the exceptions of Sempron-branded processors and Turion K8 Rev E processors, all notebook processors shipped by AMD include AMD-V and therefore support Windows 7 XP mode."

"With the exceptions of Sempron-branded processors and pre-Rev F Athlon branded processors, all of the desktop processors shipped by AMD include AMD-V and therefore support Windows 7 in XP mode."

"Also, all AMD Opteron processors shipped by AMD from Rev F forward include AMD-V."

#    Comments [1] |

Exam objectives for 70-536 with links to MSDN

Copied from : http://www.proprofs.com/forums/index.php?showtopic=11932

 

Microsoft 70-536 Objectives

Objectives as updated on Microsoft's Web site: March 29, 2007

 

Developing applications that use system types and collections
Manage data in a .NET Framework application by using the .NET Framework 2.0 system types (Refer System namespace)

Manage a group of associated data in a .NET Framework application by using collections. (Refer System.Collections namespace)

Improve type safety and application performance in a .NET Framework application by using generic collections. (Refer System.Collections.Generic namespace)

Manage data in a .NET Framework application by using specialized collections. (Refer System.Collections.Specialized namespace)

Implement .NET Framework interfaces to cause components to comply with standard contracts. (Refer System namespace)

Control interactions between .NET Framework application components by using events and delegates. (Refer System namespace)

Implementing service processes, threading, and application domains in a .NET Framework application
Implement, install, and control a service. (Refer System.ServiceProcess namespace)

Develop multithreaded .NET Framework applications. (Refer System.Threading namespace)

Create a unit of isolation for common language runtime in a .NET Framework application by using application domains. (Refer System namespace)

Embedding configuration, diagnostic, management, and installation features into a .NET Framework application
Embed configuration management functionality into a .NET Framework application. (Refer System.Configuration namespace)

Create a custom Microsoft Windows Installer for the .NET Framework components by using the System.Configuration.Install namespace, and configure the .NET Framework applications by using configuration files, environment variables, and the .NET Framework Configuration tool (Mscorcfg.msc).

Manage an event log by using the System.Diagnostics namespace.

Manage system processes and monitor the performance of a .NET Framework application by using the diagnostics functionality of the .NET Framework 2.0. (Refer System.Diagnostics namespace)

Debug and trace a .NET Framework application by using the System.Diagnostics namespace.

Embed management information and events into a .NET Framework application. (Refer System.Management namespace)

Implementing serialization and input/output functionality in a .NET Framework application
Serialize or deserialize an object or an object graph by using runtime serialization techniques. (Refer System.Runtime.Serialization namespace)

Control the serialization of an object into XML format by using the System.Xml.Serialization namespace.

Implement custom serialization formatting by using the Serialization Formatter classes.

Access files and folders by using the File System classes. (Refer System.IO namespace)

Manage byte streams by using Stream classes. (Refer System.IO namespace)

Manage the .NET Framework application data by using Reader and Writer classes. (Refer System.IO namespace)

Compress or decompress stream information in a .NET Framework application (refer System.IO.Compression namespace), and improve the security of application data by using isolated storage. (Refer System.IO.IsolatedStorage namespace)

Improving the security of the .NET Framework applications by using the .NET Framework 2.0 security features
Implement code access security to improve the security of a .NET Framework application. (Refer System.Security namespace)

Implement access control by using the System.Security.AccessControl classes.

Implement a custom authentication scheme by using the System.Security.Authentication classes. (Refer System.Security.Authentication namespace)
Encrypt, decrypt, and hash data by using the System.Security.Cryptography classes. (Refer System.Security.Cryptography namespace)

Control permissions for resources by using the System.Security.Permission classes. (Refer System.Security.Permission namespace)

Control code privileges by using System.Security.Policy classes. (Refer System.Security.Policy namespace)

Access and modify identity information by using the System.Security.Principal classes. (Refer System.Security.Principal namespace)

Implementing interoperability, reflection, and mailing functionality in a .NET Framework application
Expose COM components to the .NET Framework and the .NET Framework components to COM. (Refer System.Runtime.InteropServices namespace)

Call unmanaged DLL functions in a .NET Framework application, and control the marshaling of data in a .NET Framework application. (Refer System.Runtime.InteropServices namespace)

Implement reflection functionality in a .NET Framework application (refer System.Reflection namespace), and create metadata, Microsoft intermediate language (MSIL), and a PE file by using the System.Reflection.Emit namespace.

Send electronic mail to a Simple Mail Transfer Protocol (SMTP) server for delivery from a .NET Framework application. (Refer System.Net.Mail namespace)

Implementing globalization, drawing, and text manipulation functionality in a .NET Framework application
Format data based on culture information. (Refer System.Globalization namespace)

Enhance the user interface of a .NET Framework application by using the System.Drawing namespace.

Enhance the text handling capabilities of a .NET Framework application (refer System.Text namespace), and search, modify, and control text in a .NET Framework application by using regular expressions. (Refer System.Text.RegularExpressions namespace)

#    Comments [0] |
# Wednesday, June 03, 2009

Switching to Bing (and looking at BING API)

Today I’m switching my default search provider in Internet Explorer over to the new Microsoft Search Engine: Bing.

It seems fast, perhaps even faster than Google and with the few searches I’ve done it seems to provide the right results.

Did some quick looking around, there is a Bing developer page and Bing API as well.

Links:

#    Comments [0] |
# Tuesday, June 02, 2009

LINQ to SQL to remain alive a little longer? LINQ to SQL changes in .NET 4.0

I guess the success for LINQ to SQL makes it hard for Entity Framework to absorb the full feature set in a single (v2) release. The team has been working on a bunch of fixes and improvements to be delivered in .NET 4.0.

Here is the list as posted by Damien:

LINQ to SQL changes in .NET 4.0
Change list
Performance
  • Query plans are reused more often by specifically defining text parameter lengths
  • Identity cache lookups for primary key with single result now includes query.Where(predicate).Single/SingleOrDefault/First/FirstOrDefault
  • Reduced query execution overhead when DataLoadOptions specified (cache lookup considers DataLoadOptions value equivalency – post beta 1)
Usability
  • ITable<T> interface for additional mocking possibilities
  • Contains with enums automatically casts to int or string depending on column type
  • Associations can now specify non-primary-key columns on the other end of the association for updates
  • Support list initialization syntax for queries
  • LinqDataSource now supports inherited entities
  • LinqDataSource support for Dynamic Data query extenders added
Query stability
  • Contains now detects self-referencing IQueryable and doesn't cause a stack overflow
  • Skip(0) no longer prevents eager loading
  • GetCommand operates within SQL Compact transactions
  • Exposing Link<T> on a property/field is detected and reported correctly
  • Compiled queries now correctly detect a change in mapping source and throw
  • String.StartsWith, EndsWith and Contains now correctly handles ~ in the search string
  • Now detects multiple active result sets (MARS) better
  • Associations are properly created between entities when using eager loading with Table-Valued Functions (TVFs)
  • Queries that contain sub-queries with scalar projections now work better
Update stability
  • SubmitChanges no longer silently consumes transaction rollback exceptions
  • SubmitChanges deals with timestamps in a change conflict scenario properly
  • IsDbGenerated now honors renamed properties that don't match underlying column name
  • Server-generated columns and SQL replication/triggers now work instead of throwing SQL exception
General stability
  • Binary types equate correctly after deserialization
  • EntitySet.ListChanged fired when adding items to an unloaded entity set
  • Dispose our connections upon context disposal (ones passed in are untouched)
SQL Metal
  • Foreign key property setter now checks all affected associations not just the first
  • Improved error handling when primary key type not supported
  • Now skips stored procedures containing table-valued parameters instead of aborting process
  • Can now be used against connections that use AttachDbFilename syntax
  • No longer crashes when unexpected data types are encountered
LINQ to SQL class designer
  • Now handles a single anonymously named column in SQL result set
  • Improved error message for associations to nullable unique columns
  • No longer fails when using clauses are added to the partial user class
  • VarChar(1) now correctly maps to string and not char
  • Decimal precision and scale are now emitted correctly in the DbType attributes for stored procedures
  • Foreign key changes will be picked up when bringing tables back into the designer without a restart
Code generation (SQL Metal + LINQ to SQL class designer)
  • Stored procedures using original values now compiles when the entity and context namespaces differ
  • Virtual internal now generates correct syntax
  • Mapping attributes are now fully qualified to prevent conflicts with user types
  • KnownTypeAttributes are now emitted for DataContractSerializer with inheritance
  • Delay-loaded foreign keys now have the correct, compilable, code generated
  • Using stored procedures with concurrency no longer gets confused if entities in different namespace to context
  • ForeignKeyReferenceAlreadyHasValueException is now thrown if any association is loaded not just the first
Potentially breaking changes

We worked very hard to avoid breaking changes but of course any potential bug fix is a breaking change if your application was depending on the wrong behavior. The ones I specifically want to call out are:

Skip(0) is no longer a no-op

The special-casing of 0 for Skip to be a no-op was causing some subtle issues such as eager loading to fail and we took the decision to stop special casing this. This means if you had syntax that was invalid for a Skip greater than 0 it will now also be invalid for skip with a 0. This makes more sense and means your app would break on the first page now instead of subtlety breaking on the second page. Fail fast :)

ForeignKeyReferenceAlreadyHasValue exception

If you are getting this exception where you weren’t previously it means you have an underlying foreign key with multiple associations based on it and you are trying to change the underlying foreign key even though we have associations loaded.Best thing to do here is to set the associations themselves and if you can’t do that make sure they aren’t loaded when you want to set the foreign key to avoid inconsistencies.

#    Comments [0] |

Loading data from Excel 2007

I’m playing around with code generation using Visual Studio 2008 T4 and I needed to pull in some data. Easiest way to create the data is using Excel and then pull it into a dataset. Using the right connection string this becomes very easy.

The code below shows how to select the data from a worksheet.

public class Excel2007Reader

{

    private static string BuildExcelConnection( string filename )

    {

        return @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + filename + @";Extended Properties=""Excel 12.0;HDR=YES;""";

    }

 

    public static DataSet Read( string filename, string worksheet, string range, string tableName )

    {

        DataSet result = new DataSet();

        string connectionString = BuildExcelConnection( filename );

        string select = @"SELECT * FROM [" + worksheet + "$" + range + "]";

        using ( OleDbConnection conn = new OleDbConnection( connectionString ) )

        {

            conn.Open();

            using ( OleDbCommand cmd = new OleDbCommand( select, conn ) )

            {

                OleDbDataAdapter da = new OleDbDataAdapter( cmd );

                da.Fill( result, tableName );

            }

            conn.Close();

        }

        return result;

    }

}

#    Comments [0] |