Friday, June 19, 2009

If you are looking for some nice controls for your next Silverlight 3 application, then make sure and stop by VectorLight.Net.  These controls seem to be very light weight and stable, and best of all, they are currently free.  A Live Demo of the controls can be found here.

The list of current offerings include:

  • Color Selector
  • Dropdown
  • Fieldset
  • File upload
  • ItemViewer
  • Magnifier
  • Main Menu
  • Menu ( popup )
  • Popup Bubble
  • Popup Dialog
  • Popup MessageBox
  • Progress Bar
  • Rich TextBlock
  • Rich TextBox
  • Roller Blind
  • Scroller
  • Spell Checker
  • Table
  • TextBlock Plus
  • Text Rotator Blind
  • Tree View
  • Viewer

demo_controls

posted on Friday, June 19, 2009 12:24:17 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]


 Tuesday, May 12, 2009

Two months after it’s initial release, Microsoft has updated it’s RIA services. 

.NET RIA Services May 2009 Preview

Today we posted a minor update to .NET RIA Services.  This release is mainly focused on addressing bug fixes we have heard in the forums and delivering on a few key areas… There are a lot of other long lead work items that will fall into future releases. 

Download it today from: http://code.msdn.microsoft.com/RIAServices

Here is a list of what is available in the May 2009 Preview:-

  1. Tons of bug fixes. Most of the bugs reported in the forum have been addressed.
  2. New Business application Template… This template adds login\create new user to the Silverlight Navigation Application template.

    image

    imageimage

  3. Authentication Sample
  4. XML Metadata provider Sample…  We have heard very clearly that folks want an option to store validation metadata outside of custom attributes.  This sample shows how to find metadata in an Xml file, but you could easily extend to find validation information from a database.
  5. Linq2Sql Domain Provider Sample..  Out of the box we support POCO (plan old CLR object), Linq2Sql and Entity Framework, but we know folks are actively looking into building support for nHibernate, Sharepoint, etc.   This is a great sample that shows you the ends and outs of writing a provider.  It is the actual product code we use for the Linq2Sql provider (plus a little clean up).
  6. Updated asp:DomainDataSource that works great with asp Dynamic Data

All the samples (March 2009 and May 2009) can be found at http://code.msdn.microsoft.com/RIAServices

posted on Tuesday, May 12, 2009 9:46:53 AM (Eastern Standard Time, UTC-05:00)  #    Comments [1]


 Tuesday, May 13, 2008

Visual Studio 2008 and the .NET Framework 3.5 Service Pack 1 is now in beta and available for download from MSDN. Make sure you don't install it on your development machine until you've tested your setup in a virtual environment.

 

Here is the feature set copied from Microsoft's website:

Visual Studio 2008 Service Pack 1 includes:
  • Improved designers for building WPF applications
  • Full support for SQL Server 2008
  • The introduction of the ADO.NET Entity Designer
  • Visual Basic and Visual C++ components and tools (including an MFC-based Office 2007 style 'Ribbon')
  • Improvements to Team Foundation Server to respond to customer feedback on version control usability and performance, improved e-mail integration with work item tracking and full support for hosting on SQL Server 2008
  • Improvements for Web development including richer JavaScript support, enhanced AJAX and data tools, and Web site deployment
The .NET Framework 3.5 Service Pack 1 includes:
  • Performance increases between 20-45% for WPF-based applications - without having to change any code
  • WCF improvements that give developers more control over the way they access data and services
  • Streamlined installation experience for client applications
  • Improvements in the area of data platform, such as the ADO.NET Entity Framework, ADO.NET Data Services and support for SQL Server 2008's new features.

Additional Details

In addition, Service Pack 1 for the .NET Framework and Visual Studio 2008 includes a number of new features:

  • Windows Presentation Foundation (WPF) and Visual Designer Changes
  • .NET Framework 3.5 Client Profile
  • New ADO.NET Data Features
  • Team Foundation Server Improvements
Windows Presentation Foundation (WPF) and Visual Designer Changes
  • Cold startup performance improvement ranging between 20-45% depending on application size without needing to modify any code.
  • Additional WPF features for text, graphics, and media to deliver better performance. For example, effects like DropShadow and Blur were implemented using software rendering; with Service Pack 1 these are now implemented using hardware acceleration. Other examples include:
    • Text, especially when used in Visual and DrawingBrush, is substantially faster.
    • Data scalability improvements - Container Recycling, TreeView virtualization, and more to enable richer data editing support
    • Media performance improvements
    • A much improved WriteableBitmap that enables real-time bitmap updates from a software surface
  • Visual Studio 2008 introduced a brand new designer for WPF applications. Since Visual Studio 2008 released many additional features have become available for inclusion in the designers. These include event tab support within the property grid for control events, toolbox support within source mode, and a variety of other common asks and improvements.
Windows Communication Foundation (WCF) and Workflow Foundation (WF) Changes
  • New Hosting Wizard for WCF Service projects.
  • Enhancements in Test Client such as support for RM Sessions, Message Contract and Nullable<T> types enables testing of broader set of WCF-based services.
  • Expanding reach of DataContract Serializer by relaxing the need of having [DataContract]/ [DataMember] on types and by supporting an interoperable mechanism for dealing with object references.
  • Improved Partial Trust Debugging Experience with support for Event Log.
  • Support for ADO.NET Entity Framework entities in WCF contracts.
  • Improvements in writing REST based services ranging from easily supporting ServiceDocuments publication and consumption to providing greater control and usability of UriTemplate.
  • Significant performance improvements on large workflow-based projects in Visual Studio.
  • Considerable scalability increases for hosted WCF services in IIS7-integrated mode.
posted on Tuesday, May 13, 2008 11:42:36 AM (Eastern Standard Time, UTC-05:00)  #    Comments [3]


 Wednesday, February 20, 2008

Microsoft has announced a new program called DreamSpark to get over $2000.00 of free developer tools into the hands of college students. It is a bit too late for me, but I still wouldn't mind having that 12-month free membership to the XNA creators club.

The full list of free software:

  • Visual Studio 2005 Professional Edition
  • Visual Studio 2008 Professional Edition
  • XNA Game Studio 2.0
  • 12-month free membership in the XNA Creators Club
  • Expression Studio, which includes Expression Web, Expression Blend, Expression Design and Expression Media
  • SQL Server 2005 Developer Edition
  • Windows Server 2003, Standard Edition
  • SQL Server Developer Edition
  • Virtual PC 2007
  • Visual Basic 2005
  • Visual C++ 2005
  • Visual C# 2005
  • Visual J# 2005
  • Visual Web Developer 2005

Full information can be found at https://downloads.channel8.msdn.com/

posted on Wednesday, February 20, 2008 2:09:15 PM (Eastern Standard Time, UTC-05:00)  #    Comments [1]


 Wednesday, January 30, 2008

Looks like the "Day 1" or the first comic from the Heroes Happen Here series has been released. This comic was released by Microsoft and Seagate so make sure and signup for the RSS Feed to receive the comic everyday of the working week.

 

DailyComic_Full

posted on Wednesday, January 30, 2008 3:28:47 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]


 Thursday, January 24, 2008

imageSo you just got done prototyping that new Winform or WPF application and the interface is a bit lacking. You are a programmer, not an artist after all. Well, never fear, free icons are here (wow that really rhymed). All kidding aside, most of us are not good at drawing images and icons, so we need some resources for these items.

Our journey starts with Visual Studio 2005. If you recall, it  had  a zip file called VS2005ImageLibrary located at Program Files\Microsoft Visual Studio 8\Common7\VS2005ImageLibrary\. This file contained a nice collection of icons, animations, buttons and a variety or other objects that you could use within your application. Here are the instructions on how and where to extract the images.

After installing Visual Studio 2008, I checked to see if this library was still available and was happily surprised to find it still located at Program Files\Microsoft Visual Studio 9.0\Common7\VS2008ImageLibrary\1033\VS2008ImageLibrary\.   Here you will find images taken from Microsoft programs such as Office and Vista, along with some cool animations for your progress displays.

 

HTML_Webpage Dialogs_XP X's 

 

Our next stop is online, where there are plenty of resources to find images. I ran across an excellent one the other day on Damen Guard's Blog. This collection, Silk Companion #1, looked to be over a 450+ top quality 16x16 icons in PNG format. These were mostly derived from a larger collection at FAMFAMFAM. Here you find over the original 1000+ icons that can be used under the Creative Commons Attribution 2.5 License.

 

image

I also stopped by Icon Factory, but their freeware icons and images were not licensed for redistribution and can only be use as desktop icons. Not much good for a us programmers.

My next step will be to start compiling a list of the best of the best graphical resources, targeted for us, the programmers. If anyone has any suggestions, please feel free drop me a note.

 

kick it on DotNetKicks.com

posted on Thursday, January 24, 2008 1:49:33 AM (Eastern Standard Time, UTC-05:00)  #    Comments [3]


 Friday, January 18, 2008

I wrote some code last year to create an Microsoft Access Database, fill in some data and email it out. It never made it out to production so I thought I would share part of it here. Let's focus on creating the database in this post.

The first thing you need to do is get a COM reference to the Microsoft ADO Ext. X.X for DDL and Security. The X.X represents whatever version you happen to have on your machine. Mine used to be version 2.7, but with Visual Studio 2008, it was updated to 6.0.

AddReference

Once you have added the reference, ADOX will be added to the using section of your code.

 Using

Next you will want to create the catalog for the database. Insert the filename you wish into the following string and pass it to the CatalogClass.

   1:              CatalogClass cat = new CatalogClass();
   2:   
   3:              string tmpStr;
   4:              string filename = "Sample.MDB";
   5:              
   6:              tmpStr = "Provider=Microsoft.Jet.OLEDB.4.0;";
   7:              tmpStr += "Data Source=" + filename + ";Jet OLEDB:Engine Type=5";
   8:   
   9:              cat.Create(tmpStr);

The next step is to create the table and columns for your database. This is a pretty straight forward operation as shown in the example below.

   1:              Table nTable = new Table();
   2:              nTable.Name = "PersonData";
   3:                 
   4:              nTable.Columns.Append("LastName", DataTypeEnum.adVarWChar, 25);
   5:              nTable.Columns.Append("FirstName", DataTypeEnum.adVarWChar, 25);
   6:              nTable.Columns.Append("Address 1", DataTypeEnum.adVarWChar, 45);
   7:              nTable.Columns.Append("Address 2", DataTypeEnum.adVarWChar, 45);
   8:              nTable.Columns.Append("City", DataTypeEnum.adVarWChar, 25);
   9:              nTable.Columns.Append("State", DataTypeEnum.adVarWChar, 2);
  10:              nTable.Columns.Append("Zip", DataTypeEnum.adVarWChar, 9);
  11:    
  12:              cat.Tables.Append(nTable);
 

The final step is very important or you will get error when you close your application. Once the all the tables and columns have been added, you will need to release the com objects properly and in the proper order.

   1:              System.Runtime.InteropServices.Marshal.FinalReleaseComObject(nTable);
   2:              System.Runtime.InteropServices.Marshal.FinalReleaseComObject(cat.Tables); 
   3:              System.Runtime.InteropServices.Marshal.FinalReleaseComObject(cat.ActiveConnection); 
   4:              System.Runtime.InteropServices.Marshal.FinalReleaseComObject(cat);
 
That is it. You should now have a Access Database that you can write to. Hope this helps.
 
kick it on DotNetKicks.com
posted on Friday, January 18, 2008 3:11:18 AM (Eastern Standard Time, UTC-05:00)  #    Comments [2]


 Thursday, January 17, 2008

A coworker showed me this neat new feature of Visual Studio 2008. If you right click within the code editor and roll your mouse over Organize Usings, three options will come up; Remove Unused Usings, Sort Usings and Remove and Sort. The names are pretty self explanatory so I won't bore you and explanation of each; just wanted to pass on the good word.

sshot-2

 

kick it on DotNetKicks.com

posted on Thursday, January 17, 2008 6:33:19 PM (Eastern Standard Time, UTC-05:00)  #    Comments [3]


 Wednesday, January 16, 2008

Have you ever wanted to be able to extend a sealed class like string? With Visual Studio 2008 and C# 3.0, you now can with Extension Methods. You create these new methods to add additional custom abilities to an existing type, even if you don't have access to it. These new methods need to be static methods contained in static classes, and the first parameter should be the keyword this and the hosting type. This is demonstrated in the example below on line 8. This example takes input from the console and validates it against a regex string.

   1:  using System;
   2:  using System.Text.RegularExpressions;
   3:   
   4:  namespace ExtensionMethods
   5:  {
   6:      public static class MyClass
   7:      {
   8:          public static bool ValidPhoneNumber(this string s)
   9:          {
  10:              string valid_phone = "^[\\(]{0,1}([0-9]){3}[\\)]{0,1}[ ]?([^0-1]){1}([0-9])" +
  11:                                   "{2}[ ]?[-]?[ ]?([0-9]){4}[ ]*((x){0,1}([0-9]){1,5}){0,1}$";
  12:   
  13:              Regex regex = new Regex(@valid_phone);
  14:              return regex.IsMatch(s);
  15:          }
  16:      }
  17:      
  18:      class Program
  19:      {
  20:          static void Main(string[] args)
  21:          {
  22:              Console.Write("Please Enter Phone Number: ");
  23:              string newPhone = Console.ReadLine();
  24:   
  25:              if (newPhone.ValidPhoneNumber()) 
  26:                  Console.WriteLine("Good Phone Number");
  27:              else    
  28:                  Console.WriteLine("Bad Phone Number");
  29:   
  30:              Console.ReadLine();
  31:          }
  32:      }
  33:  }

Once the class has been created, it can be used as an extension of the string class as simply as if it was originally part of the it.

Other examples can be found at the blogs for David Hayden, or Scott Guthrie.

kick it on DotNetKicks.com

posted on Wednesday, January 16, 2008 5:34:10 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]


 Tuesday, January 15, 2008

Last week a co-worker let me know about these free E-books from Microsoft Press. It looks as if the LINQ book is in fact the full book while the other two on ASP.NET and SilverLight 1.0 are excerpts. More information can be found at the Microsoft Learning Portal.

 

MicrosoftLINQAJAXSilverlight

 

The free e-book includes content from three recent publications from Microsoft Press:

Introducing Microsoft LINQ by Paolo Pialorsi and Marco Russo (ISBN: 9780735623910)
This practical guide covers Language Integrated Query (LINQ) syntax fundamentals, LINQ to ADO.NET, and LINQ to XML. The e-book includes the entire contents of this printed book!

Introducing Microsoft ASP.NET AJAX by Dino Esposito (ISBN: 9780735624139)
Learn about the February 2007 release of ASP.NET AJAX Extensions 1.0, including an overview and the control toolkit.

Introducing Microsoft Silverlight 1.0 by Laurence Moroney (ISBN: 9780735625396)
Learn how to use Silverlight to simplify the way you implement compelling user experiences for the Web. Discover how to support an object-oriented program model with JavaScript.

kick it on DotNetKicks.com
posted on Tuesday, January 15, 2008 8:42:57 AM (Eastern Standard Time, UTC-05:00)  #    Comments [2]


 Monday, September 10, 2007

Return of the Stored Procedure

We have seen a couple examples of how to use LINQ to SQL in the previous posts  LINQ to SQL Part 1, LINQ to SQL Part 2, and how easy it is to use. The next question now becomes, What if your company strictly uses stored procedures for all of its data accessing?  Companies today can have stored procedures number from the hundreds to the thousands. With LINQ to SQL, you can still call your stored procedures and even mix and match the type styles.

First off, if you are using SQLMETAL, you will have to add an extra parameter to your DataContext build. Here is the needed extra parameter hi-lighted in red. This will again build the needed class to enable you to access the database.

SQLMETAL /SERVER:ORCASBETA2_VSTS\SQLEXPRESS /DATABASE:NORTHWIND /CODE:NWIND.CS /SPROCS

Once we have the class built and added to our project, we can get down to work. Here is a some sample code using the Northwind database.

   1: static void TestWithAdo()
   2:        {
   3:            SqlConnection conn = new SqlConnection(Properties.Settings.Default.NorthwindConnectString);
   4:  
   5:            SqlCommand spCommand = new SqlCommand("SalesByCategory", conn);
   6:            spCommand.CommandType = CommandType.StoredProcedure;
   7:            spCommand.Parameters.Add("@CategoryName", "Seafood");
   8:            spCommand.Parameters.Add("@OrdYear", "2007");
   9:  
  10:            conn.Open();
  11:  
  12:            SqlDataReader reader = spCommand.ExecuteReader();
  13:            while (reader.Read())
  14:            {
  15:                Console.WriteLine("{0,-20}\t{1,10:c}",
  16:                            reader["ProductName"].ToString().PadRight(20, ' ').Substring(0, 20),
  17:                            reader["TotalPurchase"]);
  18:            };
  19:  
  20:            reader.Close();
  21:            conn.Close();
  22:        }

First, let's look at the standard ADO.NET way of accessing a stored procedure in .NET.  We create a SqlConnection object, followed by a SqlCommand Object. We than have to add parameters and open the connection. Finally, we need to create an SqlDataReader object before we can retrieve the first row of data from the database. Quite a few steps for each a every stored procedure we wish to call. 

Now lets take a look at LINQ to SQL 

   1: static void TestWithLinq()
   2:         {
   3:             Northwind db = new Northwind(Properties.Settings.Default.NorthwindConnectString);
   4:  
   5:             var SalesReport = db.SalesByCategory("Seafood", "2007");
   6:  
   7:             foreach (var SalesItem in SalesReport)
   8:             {
   9:                 Console.WriteLine("{0,-20}\t{1,10:c}",
  10:                         SalesItem.ProductName.PadRight(20, ' ').Substring(0, 20),
  11:                         SalesItem.TotalPurchase);
  12:             }
  13:         }

With LINQ we can really reduce most of the needed ADO.NET code down to just a line or two.  Once the Northwind object has been instantiated, we can simply call the stored procedure like any other method in the class as observed in the above code.  I don't know any programmer that uses SQL day in and out that won't be foaming at the mouth for this.

kick it on DotNetKicks.com
posted on Monday, September 10, 2007 3:48:36 PM (Eastern Standard Time, UTC-05:00)  #    Comments [1]


 Thursday, August 30, 2007
In LINQ to SQL Part 1 I used a very simple query, almost too simple.  This time I want to take it a step up and add a few joins into the mix, and show how to handle them. Below is a standard TSQL query that will to pull the employee name and his/her territory and region from the Northwind database.  We start all selecting the four columns we want pulled and join several tables together.  Finally, we order the results by lastname and then by firstname. Nothing odd or strange here in TSQL.
 
   1: select e.lastname, e.firstname, t.territoryDescription,r.regiondescription
   2: from employees e
   3: join employeeterritories et on e.employeeid = et.employeeid 
   4: join territories t on t.territoryid = et.territoryid
   5: join region r on r.regionid = t.regionid
   6: order by lastname,firstname
 
In LINQ we once again write our code in somewhat of a reverse order. We start with the from statement and than do our joins statements , followed by the orderby and then select the four columns we want pulled into our resultset. This resultset will be a enumerable anonymous type that can be used with databinding or use with a simple foreach statement.
 
   1: var EmployeeList = from employees in nw.Employees
   2:                    join employeeTerritories in nw.EmployeeTerritories 
   3:                      on employees.EmployeeID equals employeeTerritories.EmployeeID
   4:                    join territories in nw.Territories 
   5:                      on employeeTerritories.TerritoryID equals territories.TerritoryID                               
   6:                    join region in nw.Region 
   7:                      on territories.RegionID equals region.RegionID  
   8:                    orderby employees.LastName,employees.FirstName 
   9:                    select new
  10:                    {
  11:                        employees.LastName,
  12:                        employees.FirstName,
  13:                        territories.TerritoryDescription,
  14:                        region.RegionDescription 
  15:                    };

The following code shows not only the query above, but how simple it is to loop through your resultset and display the information. Remember, when writing your code, you will get the full use of intellisense to help you.

   1: using System;
   2: using System.Collections.Generic;
   3: using System.Linq;
   4: using System.Text;
   5:  
   6: namespace ConsoleTest001
   7: {
   8:  
   9:     class Program
  10:     {
  11:         static void Main(string[] args)
  12:         {
  13:             Northwind nw = new Northwind(Properties.Settings.Default.NorthwindConnectString);
  14:  
  15:             var EmployeeList = from employees in nw.Employees
  16:                                join employeeTerritories in nw.EmployeeTerritories 
  17:                                  on employees.EmployeeID equals employeeTerritories.EmployeeID
  18:                                join territories in nw.Territories 
  19:                                  on employeeTerritories.TerritoryID equals territories.TerritoryID                               
  20:                                join region in nw.Region 
  21:                                  on territories.RegionID equals region.RegionID  
  22:                                orderby employees.LastName,employees.FirstName 
  23:                                select new
  24:                                {
  25:                                    employees.LastName,
  26:                                    employees.FirstName,
  27:                                    territories.TerritoryDescription,
  28:                                    region.RegionDescription 
  29:                                };
  30:                           
  31:             foreach(var e in EmployeeList)
  32:             {
  33:                 Console.WriteLine("{0,-10} {1,-10}\t{2}\t{3,20}", 
  34:                                     e.LastName, 
  35:                                     e.FirstName,
  36:                                     e.TerritoryDescription.PadRight(20,' ').Substring(0,20),
  37:                                     e.RegionDescription);
  38:             }
  39:  
  40:             Console.ReadLine();
  41:  
  42:         }
  43:     }
  44: }

Here is the result of of the LINQ to SQL query written out to the console.

sshot-2

 

kick it on DotNetKicks.com
posted on Thursday, August 30, 2007 2:37:15 PM (Eastern Standard Time, UTC-05:00)  #    Comments [2]


 Wednesday, August 22, 2007
An upcoming new feature of C# 3.0 and part of Visual Studio 2008 ( Orcas ) will be Automatic Properties. This feature is meant to help reduce the number of lines of code a developer has to make and improve the developer experience. Currently, when a developer creates a new class, he has to create a getter and setter for each field. This seems rather redundant when you have no initial setup logic to add, but there are very good reasons such as data binding and future assembly compatibility.  I'm sure most developers have written code similar to the following before:
 
   1: class Customer
   2: {
   3:     private string _FirstName;
   4:     private string _LastName;
   5:  
   6:     public string FirstName
   7:     {
   8:         get
   9:         {
  10:             return _FirstName;
  11:         }
  12:         set
  13:         {
  14:             _FirstName = value;
  15:         }
  16:     }
  17:     public string LastName
  18:     {
  19:         get
  20:         {
  21:             return _LastName;
  22:         }
  23:         set
  24:         {
  25:             _LastName = value;
  26:         }
  27:     }
  28: }

A pretty straight forward customer class with two properties ( FirstName, LastName ).  Now with automatic properties, the same code can be compressed down to fewer lines. When the compiler encounters code like the following, it will automate the generation of the private fields along with get and set method.  This lets the developer write fewer lines of code up front and follow good class design. Later on, if needed, the developer can put custom getter/setter code without having to recompile the consuming assembly.

   1: class Customer
   2: {
   3:     public string FirstName { get; set; }
   4:     public string LastName { get; set; }
   5: }

The last information I've heard is that this as a C# only feature. I haven't heard of anything similar for VB.NET at this time. 

posted on Wednesday, August 22, 2007 1:11:03 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]


 Tuesday, August 21, 2007

I'm sure everyone so far has at least heard of LINQ. If you haven't, it is Microsoft's new technology for Language Integrated Querying.  LINQ is part of the upcoming 3.5 .Net Framework which will be part of Visual Studio 2008 ( codename Orcas ). LINQ will be able to query in memory objects such as Generics or datasets  in addition to external items like XML documents and SQL databases. As of this post, Visual Studio 2008 is currently in Beta 2 and available for download from Microsoft.

The flavors of LINQ include:

  • LINQ to SQL
  • LINQ to Objects
  • LINQ to  Datasets
  • LINQ  to XML

This will be a LINQ to SQL example so I will be using the standard Northwind database for this article, you will need it installed onto your machine. If you will be using the SQL Express Edition I would also recommend installing SQL Management Studio Express. It will make the management of your database much easier.

The first thing we need to do is to create a DataContext for the our Northwind database. There are two ways to do this: 1. Use SQLMETAL to create a entity class if you need to model a complete database automatically. This way is also useful if you need have a constantly changing scheme since you can have SQLMETAL run each time you build your application using the Pre-Build Event.  2. The second way is to create a DataContext via the LINQ to SQL template under 'Add new Item to Project', but I won't be going into that way in this article.

Open a command prompt and go to your project directory and type:

SQLMETAL /SERVER:ORCASBETA2_VSTS\SQLEXPRESS /DATABASE:NORTHWIND /CODE:NWIND.CS

This will generate a class file that you can add to you project by right clicking Project->Add->Existing Items and selecting the nwind.cs for the file list.  You will next need to add a reference to System.Data.Linq to your project and then your will be ready to add your code. The following code queries the customer table for all records and adds the CustomerName to a listbox on the screen.

   1: namespace Linq001
   2: {
   3:     /// <summary>
   4:     /// Interaction logic for Window1.xaml
   5:     /// </summary>
   6:     public partial class Window1 : Window
   7:     {
   8:         public Window1()
   9:         {
  10:             InitializeComponent();
  11:         }
  12:  
  13:         private void LoadButton_Click(object sender, RoutedEventArgs e)
  14:         {
  15:          
  16:             Northwind nw = new Northwind(@Properties.Settings.Default.NorthwindConnectionString );
  17:  
  18:             var CustomerList = from Customers in nw.Customers
  19:                                select Customers;   
  20:  
  21:             foreach(Customers c in CustomerList)
  22:             {
  23:                 CustomerListBox.Items.Add(c.CompanyName); 
  24:             }
  25:             
  26:         }
  27:     }
  28: }

As you can see, this process is pretty straight forward. Notice the reverse SQL statement order. The from clause comes before the select statement. The result is put into a anonymous type that can be iterated through with a for each loop and added to the listbox.

image

This a extremely simple first example. I will delve into this subject much deeper in the coming weeks.

 

kick it on DotNetKicks.com

posted on Tuesday, August 21, 2007 3:35:51 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]


 Monday, August 20, 2007

This video was played before the keynote at TechEd 2007.  Funny Stuff.


If you have problem with the above video, you can try here.

posted on Monday, August 20, 2007 12:03:42 PM (Eastern Standard Time, UTC-05:00)  #    Comments [1]


 Tuesday, August 07, 2007

aa700830_VS2008hero_2 

Visual Studio 2008 Beta 2 is out and available for download now. It is sort of funny that beta 1 was named Visual Studio 2007. Anyway, beta 2 can be installed side-by-side to VS 2005. Hopefully, we won't encounter the same removal issue we did with VS 2005.  A go-live license is also included with .NET 3.5.

Some of the coolest new features with Visual Studio 2008 are:

 

  • Multi-Framework targeting support. - Now Visual Studio can target 2.0, 3.0, and the 3.5 framework.
  • New Web Designer with CSS support and Nested Master Pages.
  • ASP.NET Ajax and JavaScript Intellisense and debugging.
  • Language Integrated Query ( LINQ )

 

Those are just some of the new features so go download it can check it out.

posted on Tuesday, August 07, 2007 8:55:58 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]


 Friday, July 13, 2007

DevExpress is making Refactor for ASP.NET freely available to all ASP.NET 2.0 developers as an add-in to Visual Studio 2005 and Orcas, so if you don't have the Professional version yet, go download this free version of the product.

Included Refactorings

Add Validator
Create Overload
Encapsulate Field
Extract ContentPlaceHolder
Extract ContentPlaceHolder
Extract Method
Extract Property
Extract Style (Class)
Extract Style (id)
Extract to User Control
Flatten Conditional
Inline Temp
Introduce Constant
Introduce Local
Introduce Local (replace all)
Move Declaration Near Reference
Move Initialization to Declaration
Move Style Attributes to CSS
Move to Code-behind
Rename
Reorder Parameters
Replace Temp with Query
Reverse Conditional
Safe Rename
Simplify Expression
Split Initialization from Declaration
Split Temporary Variable
Surround with Update Panel
posted on Friday, July 13, 2007 1:58:27 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]


 Friday, June 08, 2007

krustyForFood Tampa Code Camp 2007

Saturday July 14th, 2007

St. Petersburg College EpiCenter
13805 58th Street North, Largo Florida

What is Code Camp? Code Camp is a FREE one day event held on Saturday July 14th 2007. This is the third year for Tampa Code Camp. The event will have speakers from the local community and beyond. Speakers will be presenting some of the most requested topics like ASP.NET AJAX, Visual Studio Orcas, Silverlight, Widows Presentation Foundation, Share Point 2007 and SQL Server 2005. This event is like Tech-Ed for Free but its community driven and its the only place you can get this content for free.

We even supply breakfast and lunch.

posted on Friday, June 08, 2007 3:35:00 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]


 Monday, May 14, 2007

I'm not sure how I missed it, but the Internet Explorer Developer Toolbar version 1.00.2188.0 was released 5/7/2007. This is a free web page development tool by Microsoft. This is an add-on for Internet Explorer that enables the developer transverse and edit the page DOM, view object class names, match CSS selectors to page elements,  use a color picker and a pixel ruler. Other features include displaying image dimensions and table outlining.  

These tools are intended to help the developer diagnose and troubleshoot their web pages and doesn't including any script debugging at this time. I'll be adding this add-in a cool developer tool list that I have been working on.

posted on Monday, May 14, 2007 1:39:37 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]


 Monday, April 23, 2007

https://www.clicktoattend.com/invitation.aspx?code=117791

Event Code: 117791

5/25/2007

9:00 AM - 4:00 PM

Welcome Time:
5/25/2007 8:30 AM Eastern Time

   

Join new and experienced Microsoft winform and web developers for a day long FREE Developer Event covering Enterprise Library and Software Factories from Microsoft Patterns and Practices. Learn to increase developer productivity and application quality using Enterprise Library building blocks, code generation, and proven practices for Smart / Mobile Clients, Web Clients, and Web Services.

More information here.

posted on Monday, April 23, 2007 6:59:07 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]


 Sunday, February 25, 2007
 At work I decided to add Ajax 1.0 for ASP.NET to a few of my web pages. With not a lot of time to dig into it, I wanted something simple and fast to use at first. Later, I could dig into using the more sophisticated features of Ajax.  

The UpdatePanel along with the UpdateProgress control seemed to be the perfect solution. Both work just like a standard panel control that holds other web controls like a container.

These extensions are really slick, but I ran into a few issues with Response.Write

My code has a routine that spawns an java alert box to display any errors messages. This is pretty standard code and will display a small popup window to output your message. This is pretty much a standard way of displaying a quick message to the user.  Nothing very special about this, except that it doesn't work with the new Ajax extensions. smile_sad 

 

   1:  Protected Sub PopErrorWindow(ByVal ErrMsg As String) 
   2:   
   3:        Response.Write("<script language='javascript'>window.alert('" & ErrMsg & "');</script>") 
   4:   
   5:  End Sub

 

After embedding my controls within the update panel, I started getting the following error from the Response.Write in the code above. It seems that Ajax doesn't like the partial postback that I was doing.

I talked it over with a co-worker and after a bit of Internet searching and experimenting around with code, I was able to come up with the following code as a solution. Seems to work fine and I haven't found any other side effects.  smile_teeth

 

   1:  Protected Sub PopErrorWindow(ByVal ErrMsg As String)
   2:   
   3:          ScriptManager.RegisterClientScriptBlock(Me.UpdatePanel1, Me.GetType, "Alert", "alert('" + ErrMsg + "')", True)
   4:         
   5:   End Sub

 

I hope this helps anyone else out there having a similar problem.

posted on Sunday, February 25, 2007 9:39:09 PM (Eastern Standard Time, UTC-05:00)  #    Comments [1]


 Monday, February 05, 2007

I was reading through my backlog of feeds ( which has gotten huge ) and ran across this little gem. It is a very cool feature of ASP.NET 2.0 that I had missed. In fact, I can't seem to find any reference to it in two of my ASP.NET 2.0 books. This feature is quite simple to use and extremely useful.

There are times when you may want to take your ASP.NET application offline. You may be doing a major upgrade to the code or need access to resources that may be tied up. You certainly don't want your customers seeing a "Page not Found" or some some other type of error due to upgrading code or maintenance of some sort. You want them to get a page with information on what is happening and maybe when to check back.

ASP.NET 2.0 has a special filename called app_offline.htm. This file is a standard html document and when present in the application root directory, will be shown in place of all other page requests. You can have this file on standby and when upgrade time rolls around you can simply drag the file into the application directory to be updated, update your files, and once finished you would delete the file from the directory. 

You should also note that Internet Explorer has a habit of showing "Friendly Http Errors" when the content is less than 512 bytes long. To work around this, you should either insure your page greater than 512 bytes or add some comments in the mark up to make up the difference.

The following is an example of a app_offline.htm file. The content is not limited, so you can pretty much make it say whatever you want.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Application Offline</title>
</head>
<style>
 
div {
    background-color:#ffffcc;
    padding-top:10px;
    padding-bottom:10px;
    padding-left:10px;
    padding-right:10px;
    border-style:solid;
    border-color:Black;
    border-width:1px;
}
 
</style>
<body>
    <div>
    This application is currently offline and under going maintenance. Please check back later.
    </div>
</html> 
 
This is a very simple example file. You can make yours nicely formatted with whatever graphics you require. 
 
posted on Monday, February 05, 2007 2:20:04 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]


 Monday, December 18, 2006

Ready for a New Day: Launch Tour 2007

January 18, 2007

Tampa, FL

Tampa Convention Center

333 S. Franklin Street
Tampa Florida 33602
United States

Registration: ... is now open. Click here -> Launch Event

Event Overview

Come experience how to simplify IT challenges and build stronger applications with the new software from Microsoft.

You are invited to participate in this unique experience featuring Windows Vista™, the 2007 Microsoft® Office system, and Microsoft Exchange Server 2007.
You’ll be able to:

  • Attend breakout sessions for developers and IT professionals

  • Test drive the products and evaluate their functionality

  • Network with peers, Microsoft, and local technology partners

  • Ask the experts

  • Receive valuable resources to help you take full advantage of this new software

IT Professionals will learn how Microsoft software can help:

  • Streamline deployment and management

  • Increase security, control, and reliability

  • Improve user experience and support

  • Enable and support mobile users

Developers will evaluate new software solutions and see how to:

  • Build secure applications and ensure reliability

  • Create engaging, visually stunning, and highly differentiated user interfaces that make applications more usable and productive

  • Build applications that connect users to each other and to their data, allowing them to visualize, share, and act on information

Agenda

  • Registration and Breakfast: 7:45 - 9:00 AM

  • Executive Keynote (see below for abstract): 9:00 - 10:30 AM

  • Technical Sessions (see below for track abstracts): 11:00 AM - 12:00 PM

  • Lunch: 12:00 - 1:15 PM

  • Technical Sessions (see below for track abstracts): 1:15 - 3:30 PM


Track Descriptions

Executive Keynote:

Top Microsoft executives will discuss important challenges impacting today's workplace and how Windows Vista, the 2007 Microsoft Office system, and Microsoft Exchange Server 2007 are helping customers meet these challenges. Learn how other companies have achieved success through collectively implementing these new releases. Experience how using these products can simplify how people work together; help protect and manage content; find information and improve business insight; and reduce IT costs and improve security.

IT Pro Track #1 – Desktop Support:

Join these exciting sessions that will explore the new tools to deploy Microsoft Windows Vista and the 2007 Microsoft Office system client applications. Accelerate your migrations and execute deployments while simplifying the tasks associated with managing your organization's desktops. You will also experience how new capabilities in the 2007 Microsoft Office system and Windows Vista increase operational efficiency in your company. The new user interfaces minimize training and support demands by providing end-users with significantly improved help capabilities, self-service tools, and a highly intuitive experience. Finally, experience the data visualization capabilities in Visio 2007 and the Enterprise Project and Portfolio Management help keep your systems and your business running smoothly.


IT Pro Track #2 – IT Infrastructure:
Join these sessions to learn more about the capabilities of Microsoft Office SharePoint Server 2007 and Exchange Server 2007. The sessions first walk through deploying Exchange Server 2007, along with Live Communications Server, from installation through configuration and validation. Further you will experience how Exchange Server 2007 can help improve operational efficiency within your organization. Next you will experience how Office SharePoint Server 2007 is deployed and how the new three-tiered structure of management helps you control and govern the environment. The final component shows the different ways to search, including the improvements of Windows Vista, Microsoft Office SharePoint Server, Microsoft Office, and Live.


IT Pro Track #3 – Solutions Capabilities:

Application Architects and Line of Business Specialists should join this session to learn more about how the 2007 Microsoft Office system, Windows Vista, and Exchange Server 2007 deliver new capabilities in for infrastructure and intellectual property protection, compliance and records management, secure mobile productivity, unified communications, and business intelligence.


Developer Track – Application Building:

The release of Windows Vista and the 2007 Microsoft Office System ushers in a new age of application development. Come join us as we explore the new development capabilities that allow you to build applications that discover, organize, and present information to users in new ways. You will experience how the 2007 Microsoft Office system and Windows Vista work better together for you, how to build differentiated user experiences and connected applications in Windows Vista, how to connect and extend Office client applications, and how to build key business applications on the Microsoft Office server platform.

posted on Monday, December 18, 2006 10:50:53 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]


 Friday, November 24, 2006

We started a new agile methodology a few weeks back called Scrum. I have been hearing about it for some time on various podcasts that I  listen to, but haven't had a chance to use it.  We are now into our second two week sprint and it seems to be working out. The team will have a better handle of this process after a few more of these sprints.

What is Scrum? That is the question most programmers new to it ask. First of all , it is not an acronym, it is taken from a game similar to football where the players really do try and kill each other, Rugby.  Wikipeida says this about it.

Scrummage or scrum as a way of restarting the game, either after an accidental infringement or when the ball has gone out of play. The word "scrummage" is a modification of "scrimmage" (which form of the word was previously used in rugby and continues to be used in American and Canadian football), which in turn derives from or is cognate to "skirmish".  

 

In the software development world, Scrum is a form of agile development to manage and control development work. Most companies moving to this methodology will adjust it to fit their needs. You don't have to follow the standard Scrum process exactly to get benefits from this methodology, but you shouldn't stray too far off course.

Scrum is characterized by:

  • Artifacts
    • Product Backlog
      • A list of requirements prioritized and broken down into small manageable chunks. This Backlog should include all features visible to the customer, as well as the technical requirements needed to build the product.
    • Sprint Backlog
      • This is a list of selected and committed features to deliver from the product backlog and should be created by the Team only. These tasks should be broken down into pieces that will require less than 16 hours of development time.
    • Burndown Chart
      • The Burndown Chart shows the cumulative work remaining in a Sprint. When tasks are completed, the ScrumMaster recalculates the remaining work to be done as the Sprint Backlog decreases, or burns down over time. If the cumulative Sprint Backlog is zero at the end of the Sprint, the Sprint is successful.
  • Ceremonies
    • Sprint Planning Meeting
      • These meetings are held prior to the beginning of the Sprint and during this meeting the Sprint Backlog is created.
    • Sprint Review Meeting
      • At the end of a sprint, a timeboxed 4 hour meeting is held in two parts.
        • The First half is to demonstrate the results of the previous sprint to the product owners. The Product Owner determines which items on the Product Backlog have been completed in the Sprint
        • The second half of the Sprint Review Meeting is a retrospective for the Scrum team that is led by the ScrumMaster. At this time the Team evaluates what went right and what went wrong during the sprint.
    • Daily Scrum Meetings
      • Once the planning has been completed, the sprint begins a 30 day iteration. Each day the Scrum Master leads a short 15 minutes meetings. While anyone can attend this meeting, only team members who have committed to deliver work to the Scrum are allowed to speak.  Each person is asked three questions in order to get a global snapshot of the project.
        • What did you do yesterday?
        • What are you going to do today?
        • Do you have any roadblocks?
  • Roles
    • Product Owner
      • The product owner is normally a business person and is the one that defines the features of the product.
      • This person is the person whom accepts the work presented during Sprint Review.
    • Scrum Master
      • Removes roadblocks so the team is productive.
      • Ensures that the process is followed including invitations to Sprint Planning Meetings, Daily Scrum and Sprint Reviews
    • Team
      • Cross Functional Team between 5 and 10 members.
      • Selects the Sprint Goal and Specifies work result.
      • Demonstrates work to Product Owner
      • Organizes itself and its work.

Here is a complete run down of the scrum methodology in more detail.

I'm still holding my opinion of this process until we finish a project and review what we did right and what we did wrong.

posted on Friday, November 24, 2006 11:03:38 AM (Eastern Standard Time, UTC-05:00)  #    Comments [1]


 Thursday, November 09, 2006

If you are a developer and live in the Tampa area, than you know Russ Fustino. He is our area MSDN presenter and local guru. He is having his 50th birthday party this weekend. See you all there.

 

Location: http://www.clubbourbonstreet.com
When: Sunday, Nov 12 5-8pm
Bands: Dem Applz (originals) and Night Flight (Classic rock)
Where:
Bourbon Street Night Club
4331 US Hwy 19 • New Port Richey Florida • 34652
Club Phone • 727-843-0686

posted on Thursday, November 09, 2006 1:43:38 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]


 Thursday, July 27, 2006

 

FREE .NET E-BOOK

Visual Studio .NET Tips and Tricks explains how to use VS.NET efficiently. Organized into short and easy-to-grasp sections, and containing tips and tricks on everything from editing and compiling to debugging and navigating within the VS.NET IDE, this book is a must-read for all .NET developers, regardless of expertise and whether they program in C#, VB.NET, or any other .NET language. This book covers the Visual Studio .NET 2002, 2003, and 2005 Beta 1 releases.

In this book you'll find the following:

  • More than 120 tips for editing and writing your code, navigating within the IDE, and compiling, debugging, and deploying your application
  • Section dedicated to VS.NET 2005
  • Keyboard shortcuts for the majority of tips
  • More than 90 figures and screenshots

Download from Here.

 

 

posted on Thursday, July 27, 2006 3:33:17 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]


 Wednesday, July 12, 2006

 

Microsoft Ends Windows 98 Support

 

Microsoft wanted to end support for Window 98 back in 2003, but extended it due to complains from its 70 million person user base.

Well, today, they get thier wish. Microsoft has officially ended all paid support for Windows 98, Windows 98 SE, and Windows Me.

In addition to an end to paid support, they also will no longer offer security updates.

Now, that said, I haven’t used Windows 98 or any of its cousins since the release of Windows 2000 and if my luck hold out, never will.

 

 

posted on Wednesday, July 12, 2006 4:57:56 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]


 Sunday, July 02, 2006

Tampa Bay Code Camp July 15th

If you want to improve your skills unlike this poor soul get to Code Camp we will even supply the food for lunch.

Mark your calendars for JULY 15TH 2006, Location: USF (UNIVERSITY OF SOUTH FLORIDA)

This years Tampa Code Camp is Hot, more speakers,  More Contributers, same great location but were still limited to 350 attendees so don't get left out in the cold register early.

Just in case you forgot Code Camp is FREE, and its the only place you can learn from the best out there under one roof. If you program in Visual Studio.NET you need Code Camp. If you use ASP.NET you need code camp. It doesn't matter if your an amateur or one of the coding gods you don't want to miss this event.

 

posted on Sunday, July 02, 2006 2:34:46 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]


 Wednesday, June 28, 2006

I found this over on The Daily WTF.

You can find the original link @ http://thedailywtf.com/forums/permalink/79265/79265/ShowThread.aspx#79265


_____________________________________________________________________
From: {Product Manager}
Sent: Tuesday, March 28, 2006 8:41 AM
To: A----- Selvan
Cc: {Marketing Director}
Subject: Software Version

A-----,
I've noticed that in several places (most prominently, Help-About),
there is the product version, build number, etc. Please have your team
remove this information in our next release.

______________________________________________________________________
From: A----- Selvan
Sent: Tuesday, March 28, 2006 9:03 AM
To: {Product Manager}
Cc: {Marketing Director}
Subject: Re: Software Version

The product version and build number are necessary to identify what
release the customer has. This is also key in our testing and quality
process.

______________________________________________________________________
From: {Product Manager}
Sent: Tuesday, March 28, 2006 1:29 PM
To: A----- Selvan
Cc: {Marketing Director}
Subject: Re: Software Version

Couldn't you determine this information some other way? We don't want
the customers knowing this information and need it removed.

______________________________________________________________________
From: A----- Selvan
Sent: Tuesday, March 28, 2006 1:45 PM
To: {Product Manager}
Cc: {Marketing Director}
Subject: Re: Software Version

We really can't remove it from the product, but, if you'd like, we can
hide it further. However, it is very discrete as is: it only appears in
the About dialog, release notes, and change log. But no matter what, we
will need to keep it accessible for support.

Either way, I don't really understand the request. Almost every software
program ever made has release information like this. Why would you
want it removed?

______________________________________________________________________
From: {Product Manager}
Sent: Wednesday, March 29, 2006 10:04 AM
To: A----- Selvan
Cc: {Marketing Director}
Subject: Re: Software Version

We can't be at all accessible to the client, we'll just have to find
another way.

The reason is simple: when they see  "Version 2.8 (build 448)," they
will think that it took us 28 releases and over *four hundred* builds
to get right.

______________________________________________________________________
From: {Marketing Director}
Sent: Wednesday, March 29, 2006 10:08 AM
To: A----- Selvan, {Product Manager}
Subject: Re: Software Version

This is a good point. This is *not* the information we should be
conveying to our customers. A-----, please make sure it's removed in
the next release.

posted on Wednesday, June 28, 2006 8:50:58 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]