Showing posts with label SQL Server. Show all posts
Showing posts with label SQL Server. Show all posts

VS Live October 17–21 in Redmond

We all know that PDC… I mean BUILD is coming up in a couple weeks in Anaheim, California.  Microsoft is keeping all the announcements (Including a real agenda) for BUILD really close to the vest.  One thing is for sure, there will be some fallout after BUILD.  Many questions, rumors and suspicions will be debated out there in cyberspace.  What better place to get the real answers than at Microsoft Headquarters in Redmond?  VS Live in Redmond includes sessions from some of the top names in the industry, including many Microsoft Product\Program Managers.  No one knows what will come out at BUILD (Or no one can talk about it until after BUILD).  In the short time between BUILD and VS Live the speakers will undoubtedly be up to speed on what is going on in the Microsoft world.  Join us at VS Live and have access to all the speakers to get your questions answered by real world software engineers.

Early bird rates are available until Sept. 7th.  Click on the image below to register for VS Live in Redmond and get a special speaker discount.

By the way I will be presenting on HTML 5 and MEF at VS Live in Redmond.  I sincerely hope to see you there.

Server Side and Client Side Caching with .NET and the Microsoft Sync Framework

I recently presented at the Denver Visual Studio User Group on this topic.  The approach I took was to start with an out of the box working Silverlight application and then tweak to using caching for performance reasons.  The next step is to persist that cache on the client side to make it even faster and not even require a round trip to the server.  After that I took it even further by saving the entire data structure to isolated storage to allow offline use of the application using the out of browser option of Silverlight.  Finally I expanded it even further by turning it into a WPF application that stored the data in a local SQL Server data base that was synced back to the server using the Microsoft Sync Framework.  To me this is a pretty natural progression of an application.  Build the prototype and then tweak it through different phases to expand it’s capability.

While building these demos I had to refactor a bunch of things through the progression of the changes.  This again to me is very natural.  I find that if I start by simply solving the problem the pieces of the system that need to be refactored and extend become crystal clear in the end.  Where as if I try to architect the application for every possible future change I tend to end up with an over architected system.  Again keep it simple and refactor later.

I think we all know caching is an essential part of almost every web based application.  That was the gist of the first part of the presentation.  The last part showed some of the pros and cons of the Microsoft Sync Framework.  There is some great documentation around this framework here.  If you are new to the sync framework I suggest taking the time to read through a couple of these docs to understand how it works.  My slides also contain some of information regarding the sync framework.  My personal take on it is it is pretty easy to get started with.  The issue I have is what happens when you get errors.  Synchronizing two data sources is by nature a difficult process and errors will occur.  Using this framework is kind of like using a black box.  You sometimes want more control than you are going to get.  Bottom line if I was looking to sync multiple data sources I would start with this framework.  It is a no brainer to get started with and provides a ton a cool functionality.  However, if I started having issues I might revert back to my old ways of just building a sync tool for my own need.

I had a great time presenting and putting together this talk.  Below is a link to the slides and the completed solution if you are interested.

Demos and Slides

SQL Server and .NET Virtual Conferences

I am happy to say I am presenting at the Spring ‘09 SSWUG.ORG .NET vConference on April 22, 23, 24.  I recorded my sessions earlier and I’m please with the results.  If you are not familiar with the vConference format you can get a 10 minute sample of one of my presentations here.  The cost of the conference is only $125 and since it is a virtual conference there are no additional expenses.  There really is some great content presented by outstanding presenters.  Here is the link to check out all the SSWUG vConferences going on:

https://www.vconferenceonline.com/upcoming.asp

I also wanted to point out a free event that is going on Friday, April 17th.  Here is the link to the free event:

https://www.vconferenceonline.com/shows/spring09/sql/s09event.asp

I will keep this blog updated with my content and slides once the conference begins.

LINQ : The DBA vs the Developer

At the Rocky Mountain Tech-Trifecta Eric and Johnson and I did a session related to this topic.  David Yack wanted us to do something that he could use to promote the session during his keynote.  So, we went over the top and created this video.  Enjoy!

.NET Events in Colorado

I know January is almost over, but to me the year is still new.  I wanted to inform everyone about all the awesome User Groups and Community events in Colorado.

One of the most exciting upcoming events is the first ever Rocky Mountain Tech Tri-Fecta on Saturday, Feb. 21.  I cannot explain how cool this event is going to be!  It’s basically an all day geek fix.  There will be sessions related to .NET development, SQL Server and Windows Server.  So, if you work with MS products or know someone who does this is the event for you.  We have tons of speakers (Scott Hanselman is coming!) from all over the country and many who work for Microsoft and have inside info you cannot get anywhere else.  If you like what you are hearing please be sure visit the www.rmtechtrifecta.com site to register for the event to reserve your spot.

Next I wanted to let people know about the South Colorado .NET User Group.  I have taken over the leadership of this group from Julie Yack.  Julie Yack, David Yack and David Milner round out the leadership team for this group.  Next Tuesday we have Kathleen Dollard coming down from Ft. Collins to talk about rethinking Object Orientation.  SHould be great!  Please check out the link above to get more details.

Here are the links to all the MS related user groups I can think of in Colorado.

Denver Visual Studio User Group

North Colorado .NET User Group

Boulder .Net User Group

Colorado Springs SQL Server User Group

Denver SQL Server User Group

Colorado Springs Windows User Group

Rocky Mountain Windows Technology User Group

Please let me know if I missed a group.

Entity Framework And Tables With No Primary Keys

OK, I think we can all agree that having tables without primary keys is a bad idea.  However, sometimes we are forced to use backend databases that have multiple design flaws.  In fact, database design flaws are one of the very things the Entity Framework (EF) can fix.  EF allows us to fix issues we find in a database without actually effecting the database schema at all.

Anyway, yesterday I added a table to my EF model that had no primary key.  I was surprised to learn that EF decided that since there was not a primary key it would just use all the non-nullable columns as a concatenated primary key.  This might not be what you want.

To fix the issue, I had to hack the XML and remove the keys from the table definition.  I was not able to fix it using the UI in Visual Studio 2008 SP1.  Instead, I had to right click the model file in the solution explorer and select "Open With...".   From there select the XML Editor.  Then you just need to find the table definition and remove the unwanted columns from the primary keys section.  It's a bit of a pain, but it is the only fix I know of at the time.

Let me know if you find a better solution.

Virtual Conference Day 3

Today was another great day at the vConference.  I attended some great sessions over the course of these three days and now I'm excited to go back and watch the ones I missed on demand.  I hope everyone had as much fun as I did with the conference!

I did finally get my hosting situation figured out.  That means I can get my slides and demos out here for people to download.  I do believe that the vConference site will have this stuff posted eventually, but in case they don't here you go:

SharePoint:

Business Data Catalog Part I

Business Data Catalog part II

KeyNote - SharePoint and SilverLight

.NET:

Beginning WPF Databinding

Advanced WPF Databinding

Design Patterns

KeyNote - Data Services

KeyNote - SilverLight and Cross Domain Calls

KeyNote - LINQ vs. ADO

Virtual Conference Day 2

Day 2 of the conference was just as good as day 1.  We had great sessions all day long.  I attended a bunch of the sessions and had some great conversations with many of the attendees.  One of the issues we ran into today was the demos where not available.  I was going to post them here, but I'm having some issues with my ISV and getting the files to the server.  I will post them ASAP.

In the mean time, enjoy the rest of the conference.

PDC is awesome but... Don't forget the Virtual Conference next week.

The PDC is a great place to get the latest news related to Microsoft Technologies.  It's a good idea to keep up to date with what is going on in the world of Microsoft.  However, most of the stuff released and demoed there is bleeding edge stuff that won't be available for live deploys for months or even years.  That's where the SSWUG.org Virtual Conferences being held next week come in.  Three days of great content, most of which can be used in the applications you are building right now and can be deployed TODAY!!!  Four conferences are being held that include: SQL Server, SharePoint, .NET and BI.  Not only is it great content, but's it's only $100!!!  Or if you use my discount code you can get it for $90.  My discount code is:

SPVIPBH

Please use this code to save yourself $10 and go have a burrito at Chipotle on me.  Mmmmm Chipotle.......

.NET Developer Virtual Conference - Update 9/30/2008

Just wanted to update everyone on a couple of things related to the .Net Virtual Conference.  In my previous post, I explained the idea of the conference and discussed all the great content that is available.  In these hard economic times, getting access to this type of content for $100 is a great opportunity to save some money without compromising the bottom line.  Well, things have gotten even better!  Announcing a change to the .NET Developer Virtual Conference.  Now the .NET Developer Virtual Conference also provides access to the SharePoint, Business Intelligence and the SQL Server virtual conferences.  Read the details here.  Now you pay the same price ($100) and get access to over 120 session.  Pretty awesome.  PLEASE NOTE THE DATE CHANGE FOR ALL CONFERENCES.  THE CONFERENCES WILL NOW OCCUR ON NOV. 5th, 6th and 7th.  Here is the registration link.  Do not miss out on this opportunity to be in the know!

On a personal note I recorded my sessions last week and I think they went pretty well.  My WPF talks are not the flashy, shiny WPF sessions you've seen in the past.  These sessions will help you with the actual guts of doing a useful WPF application.  Leave all that flashy, shiny stuff to those artsy designers and their black turtlenecks.

I was also subjected to an interview that was posted by Chris Shaw.  If your interested in my answers to the tough questions in the interview please click here.  Please do not be scared away by my ugly mug at the top of the article.  If you look around on Chris Shaw's blog you will find some of the interviews with the other presenters.

.NET Developer Virtual Conference : Oct. 28 - 30

Just wanted to let everyone know that I am lucky enough to be a presenter at this years SSWUG.org .Net Developer Virtual Conference in October.  This is a really cool idea where all the sessions are pre-recorded and on the days of the conference you can login and watch from the comfort of your ergonomically correct cubicle chair.  Maybe you can talk your boss into giving you the days off and you can watch in your PJs from your couch.  Either way you don't have to incur the time or the cost of traveling to an in-person conference.  This is a plus for those of you that are "Dungeon" coders.  You can get all the great content of the conference without leaving the "Dungeon" and being forced to socialize with other people.  That can be uncomfortable...

Seriously, there is some great content from some of the top presenters in the industry on deck for this conference.  I'm just glad I get a free login so I can attend some of the other presenters sessions.  Speaking of cost, you get all three days for just $100.  If you can't sell this to your boss you're never getting any training EVER.

Again there are some great topics and presenters so please use this link to check out the sessions and the presenters for this conference:

.NET Developer Virtual Conference

There are also 3 other Microsoft related virtual conferences scheduled for the fall.  Use this link to find out about all the conferences from SWWUG.org:

www.vconferenceonline.com

Are ADO.NET Datasets dead?

If you are plugged in at all to the Microsoft world you have been seeing more and more LINQ and ADO.NET Entity Framework buzz.  You can't go to a conference or attend a User Group meeting without discussing one of these new data access technologies.  I'm not saying that's a bad thing... Unless you are a Dataset, Datatable or Dataview.

I wrote a post back in May trying to shed some light on when to use which technology.  You might want to read that post and the comments before reading on.  In that post I stated that if you are creating new applications or just adding on features to your current app I would use LINQ or EF instead of ADO Datasets.  There are many reasons.  Here are the most compelling reasons to use LINQ and EF.

  • Objects - The nicest thing about LINQ and EF is they provide some of the foundations for Object Oriented programming.  They literally force you to think and work in terms of objects and collections of objects instead of rows and tables of rows.  By setting up this foundation, these technology allow for the application to grow and use some of the more complex OO concepts without doing tons of work to fill and save objects from Datasets.  So, start simple and as the requirements on your application change you can use some more complex OO topics to solve those problems.
  • Memory - There are two schools of though on this topic.  Some people like to pull all the data back into memory and then work with it there.  Others don't like to fill memory with data that might not ever be used.  LINQ and EF allow for both.  When you build your LINQ and EF models you can use stored procedures same as you used to with Datasets and bring back the whole table if you desire.  Or you can use the LINQ syntax to do filtering and sorting, which uses the power of the relational database engine to get only the row(s) you need.  To me it is compelling to have the flexibility that LINQ and EF give me.
  • Performance - We can go round and round about the performance implications here.  People say stored procedures are faster because they are pre-compiled, but with the new technologies these LINQ queries are cached and optimized and the difference is often minimal.  To me this is the 80\20 rule.  80 percent of my queries will run the same or faster in LINQ and EF than they do in a SP.  The other 20 percent of my queries will run faster in stored procedures.  So, use both.  LINQ and EF allow for using SP or the LINQ syntax.  Plus, with LINQ you can bring back only the columns you need which can improve performance as well.  I'm not saying quit using stored procedures, but instead of just blindly using them because that's what you've always done, step back and analyze your requirements to see if it's worth it. 
  • Interop with Other Object Collections - The other benefit of working with LINQ and EF is that you can join your data objects with other object collections.  If you've seen my talk on LINQ and the demo related to joining my SQL data with file data retrieved using the System.IO objects.  It is so easy and would require lots of work with Datasets.

There are many more reasons out there, but these are a few of the ones that are most important to me.  Any one else want to add?

Data Access Technologies - Should I use ADO, LINQ, nHibernate or the Entity Framework?

I came across this blog post today that explains the differences between these data access technologies.  However, it does not give a definitive answer on when to use which technology.  That's because it depends on so many factors.  My advice is to keep it simple. 

Let me expand on the different technologies and provide some guidelines on when to use them:

Classic ADO.Net - In my opinion ADO.Net is a dying breed.  As a developer you need to know it for maintenance purposes, but any new features or products should be designed using LINQ or EF\nHibernate.  Some people might not agree with me here, but again this is my opinion.  The only caveat is to make sure the target environment supports the 3.5 Framework.  If the systems people will not let you install 3.5 on the server or end user's machine then LINQ and EF will not work. 

LINQ (LINQ to SQL) - As the blog post on this states, LINQ currently only supports SQL Server.  There are tons of open source projects that do LINQ to other things, but the only MS supported database backend is SQL Server.  For many of us, that is just fine.  If you know you need to support other DB platforms you can move on to EF\nHibernate now.  If you're pretty certain the only DB backend is going to be SQL Server then the decision between LINQ to SQL or EF\NHibernate comes down to architecture.  EF\nHibernate are full blown ORM tools, meaning they include many additional features (Inheritance, complex types, multiple data sources, etc) over and beyond what LINQ to SQL provides.  So, if you are using SQL Server and the application design is not overly advanced or complex.  I'd use LINQ to SQL.

EF\nHibernate - I lumped these two tools together because they are both ORM tools.  They provide support for many advanced and complex concepts in software design.  Using these advanced features is great if you are building a large enterprise, public facing or consumer use application.  However, for many applications these tools can be overkill and end up taking too much time to design.  That being said there is one thing that often gets overlooked, the fact that you can use these tools to do one to one mapping similar to the way LINQ to SQL does.  So, if you need to support mulitple DB backends, but you don't want to use the advanced features you can do so.

In summary, if you are building a simple application that is going to use SQL Server as the DB backend, use LINQ to SQL.  If you are building a simple application that needs to support a DB backend other than SQL Server, use EF or nHibernate and do one to one mapping between your entities and your DB tables.  If you are building a large application that requires some complex architecture, use EF or nHibernate.  Don't use ADO.Net for any new projects unless the target environment does not support the .Net 3.5 Framework.  However, I don't think it is necessary to go back and rip out all your ADO.Net code and replace it with something else.  Just be patient and use the new stuff with new projects.

CS Techcasts - SQL Server and LINQ Webcast\Podcast

Last Thursday at PASS Camp in Denver I participated in a live webcast\podcast related to SQL Server topics.  Why was a developer involved?  Well I don't want to spoil the surprise so you'll just have to watch.  Wether your a SQL Server expert or just know enough to be dangerous this is a great informational cast.  Check it out!

http://www.cstechcast.com/home.aspx?Episode=15

LINQ to SQL is the Devil?

Last Thursday I attend the SQL Server Pass Camp in Denver.  As one of the only developers there I got a lot of negative vibes related to LINQ to SQL and ADO .Net Entity Framework.  DBAs seem to think any tool that generates SQL statements is evil.  I have to admit I agree with them.  Even if the generated SQL is flawless, it can take away the DBAs ability to tune performance.

However, I think there is a happy medium that will help DBAs sleep at night and still give the developers the flexibility they need.  It's the same answer we've been using for years, Stored Procedures.  If you think about it, developers have had the option of running SQL queries directly against the DB for years using inline SQL statements.  So, nothing has really changed.  LINQ to SQL and the Entity Framework both have full support for stored procedures.  Use Stored Procedures for all updates, inserts and deletes.  You can also use stored procedures to retrieve data. However this takes away some of the the flexibility LINQ to SQL and the Entity Framework provide to the developer.  So, for reads I recommend using views.  They allow DBAs to restrict the columns visible and also provide an extra layer of security.

All the feed back I received from DBAs was positive once I explained that stored procedures and views are still the best practices for these new technologies.  They were also put to ease when I reminded them that this really is nothing new for them.

So to answer the question, LINQ to SQL is not evil.

Fallout From The Colorado PASS Camp

Yesterday I attended and presented at the Colorado SQL Server PASS camp.  A developer at a SQL DBA event?  And he made it out alive?  Yep I feel like I cheated death.

No seriously, I had a great time and learned many things about some of the DBA's fear of LINQ and the ADO.Net Entity Framework.  I will post more about this subject in a separate post in the interest of not making my posts too long.

Look for a series of posts regarding the info I gathered from attending this event.  Thanks to everyone who organized and attended the event!

Posted in Labels: , | 0 comments