MSDN Code Gallery

by UnquaLe 31. January 2008 03:00

MSDN Code Gallery is storage for sample applications, code snipplets and other resources. And also you can find the conversations about these resources. To see supporting documents (Screenshots, design documents) inside resources makes it richer.  They are open to your contribution ;)

http://code.msdn.microsoft.com/ 

Tags:

Patterns & Practices Practices Checker - ASP.NET Web Applications Performance Code Review

by UnquaLe 29. January 2008 20:14

I thought it gonna be fine to cross-post it from Patterns & Practices Guidance:

The Patterns & Practices Practices Checker is a tool that helps you verify your applications against the patterns & practices performance recommendations for ASP.NET applications.

  • Use Practices Checker to help you perform a manual code inspection by analyzing your application for potential coding and configuration settings that do not adhere to the patterns & practices ASP.NET Performance Checklist.
  • Extend Practices Checker by allowing additional checklists to be created and checked.
  • Developers can utilize built in search routines to search intermediate language, static text files and .configuration files for specific code patterns or settings.

Learn more.

 

Tags: ,

Windows Live Messenger IM Control

by UnquaLe 10. January 2008 18:51

The Windows Live Messenger IM Control enables web sites to show the presence of Windows Live Messenger users and lets site visitors engage in instant messaging conversations with the Messenger users. A Web site can invite its users to share their Messenger presence and exchange messages with visitors to the site. When a site hosts the Windows Live Messenger IM Control, site visitors can instant message Messenger users directly from the browser without installing the Windows Live Messenger desktop client on their computers.

This pretty good control is easy to use. You will only add the IFrame code that Live messenger gives you then you can start having conversations with your visitors of your personal web page and blogs easly.

Helpful links,
ScreenCast
Article
MSDN

Enjoy ;)

Doga. 

Tags:

MSSQL SERVER 2008 New Features for Developers

by UnquaLe 26. November 2007 22:58

Mssql Server 2008 is close to release. It is currently releasing as CTP and still growing with new features. I went to a seminer @ Microsoft from .NET community and i ve seen some cool stuffs so  I want to preview some of them with you.

MSSQL SERVER 2008 New Features for Developers

Data Types

MSSQL Server 2k8 contains some new datatypes. These are DATE, TIME and some CLR based types.

DATE type stores only date without time. And TIME type stores only time withouth date. J It was alittle hard work to use date functions for time actions. I think these types can help us.

There is an another type for date. DATETIME2, is similir to standart DATETIME  but allows for greater precision. The range of the type is Jan 1 year 1 to 12/31/9999. So it wont be a problem to store DateTime.MinValue with this type. Also the clock is 24 hour cycle so 8 pm can be stored as the military time 20:00.

SELECT CAST('2007-10-20 20:30:05.1234567' as DATETIME2)
Results:  2007-10-20 20:30:05.1234567
SELECT CAST('2007-10-20 20:30:05.1234567' as DATETIME2(4))
Results:  2007-10-20 20:30:05.1235
 

Values that need to be time zone aware can now be stored in Mssql Server 2k8 with the DATETIMEOFFSET.

SELECT CAST('2007-10-20 20:30:05.1234567 +5:0' as DATETIMEOFFSET)
Results:  2007-10-20 20:30:05.1234567 +05:00

Demos :

CAST('2007-10-20 20:30:05.1234567 +5:0' as DATE) = 2007-10-20

CAST('2007-10-20 20:30:05.1234567 +5:0' as TIME(7)) = 20:30:05.1234567

CAST('2007-10-20 20:30:05.123' as SMALLDATETIME) = 2007-10-20 20:30:00

CAST('2007-10-20 20:30:05.123' as DATETIME) = 2007-10-20 20:30:05.123

CAST('2007-10-20 20:30:05.1234567 +5:0' as DATETIME2(7)) = 2007-10-20 20:30:05.1234567

CAST('2007-10-20 20:30:05.1234567 +5:0' as DATETIMEOFFSET(7)) = 2007-10-20 20:30:05.1234567 +05:00

FILESTREAM Data type

We always think where to store our BLOB files, in the FileSystem or in to the DB. It is hard desicion between them. You can store your files in to the db with filesystem support. For more details i think you should read this post : http://blogs.msdn.com/manisblog/archive/2007/10/21/filestream-data-type-sql-server-2008.aspx

 

HIERARCHYID

When do we need to have parent – child relationship we create a foreignKey to the table itself. So HierarchyID type will make it easy and it has some helpful funtions.
Details on here :
http://blogs.msdn.com/manisblog/archive/2007/08/17/sql-server-2008-hierarchyid.aspx

http://blogs.msdn.com/manisblog/archive/2007/08/28/sql-server-2008-hierarchyid-part-ii.aspx

 

GEOGRAPHY

Spatial data types means businesses and products can now handle complex location data and apply it against other business or technical specific data without requiring expense GIS systems.

Now we are able to insert many records to be inserted using VALUES clause of the INSERT statement.

INSERT INTO SalesFeed
(CustomerID, Product, SaleAmount)
VALUES
(1,'PoolTable', 1000),
(2,'BigScreen', 955),
(3,'Computer', 590),
(4,'BigScreen', 880),
(5,'Computer', 700)

There is a new Linq2Sql provider for sql server 2008.

There are some comprassion features, some more new T-SQL enchantments. I wantted to list these features that i like and I want to notice that Microsoft will stop supporting ms sql server 2000 in April 08’.

I hope it helps..

Tags: ,

DotNetSlackers - Ajax Data Controls

by UnquaLe 2. November 2007 19:52
DotNetSlackers has just released Ajax Data Controls (ADC) as open source. The project is hosted at codeplex and there are several live examples which can be seen at the samples link below.

The ADC contains an AjaxGridView, AjaxDataList, AjaxRepeater and they are going to add more controls very soon as well.

To get a feel for them, check out the samples page. Very cool stuff by “TheSlackers” !

Project home: http://codeplex.com/ajaxdatacontrols
Live Samples: http://dotnetslackers.com/projects/ajaxdatacontrols
Team Blog: http://dotnetslackers.com/community/blogs/sonukapoor/default.aspx
Team Blog: http://weblogs.asp.net/rashid
Forums: http://dotnetslackers.com/community/forums/71.aspx

Tags: ,

C# Generic Type Conversion

by UnquaLe 25. October 2007 02:45

I thought C# Generics are useful also for type convertion. I messed code alittle and the emergent code snippet looks fine for me. It is easy and simple. 

public class GenericConverter
{
    public static T Parse<T>(string sourceValue) where T : IConvertible
    {
      return (T)Convert.ChangeType(sourceValue, typeof(T));
    }

    public static T Parse<T>(string sourceValue, IFormatProvider provider) where T : IConvertible
    {
      return (T)Convert.ChangeType(sourceValue, typeof(T), provider);
    }
}

//Usage
DateTime datetime = GenericConverter.Parse<DateTime>("12.10.2007");


IFormatProvider providerEN = new System.Globalization.CultureInfo("en-US", true);
IFormatProvider providerTR = new System.Globalization.CultureInfo("tr-TR", true);

DateTime x = GenericConverter.Parse<DateTime>("12.10.2007", providerTR); // ddMMyyyy
DateTime y = GenericConverter.Parse<DateTime>("12.10.2007", providerEN); // MMddyyyy

int iValue = GenericConverter.Parse<int>("12");


Enjoy !.

Doga. 

Tags:

ASP.NET MVC Framework

by UnquaLe 22. October 2007 19:26
ScottGu had presented the new ASP.NET MVC Framework as a prototype last week in ALT.NET Conference.

Ultimately this is a group that believes in:

  • Continuous Learning
  • Being Open to Open Source Solutions
  • Challenging the Status Quo
  • Good Software Practices
  • DRY (Don't Repeat Yourself)
  • Common Sense when possible

It enables Test Driven Development by default. You can unit test the application without having to run the controllers within an ASP.NET process. You can use any unit-testing framework such as NUnit, NBUnit.

You can extend the framework by writing your own view engine. And the most amazing feature is to be pluggable. You can use any existing Dependency Injection and IOC container models such as Windsor, Spring.Net, NHibernate, etc.

You don't need URL-Rewriting frameworks anymore you can handle this process in your Controller classes. Your URLs will be SEO friendly easly.

These features and design choices represent a huge paradigm shift for Microsoft. They say to the open source .NET community: “We recognize your contributions, and we’re not going to try and reinvent what you’ve done. Instead, we’re going to make it pluggable, so you can use whatever technology you favor.”

It looks like Patterns & Practice team had really good job!. I wish i could be in this conference :( what a shame ! 

To watch The Gu and Scott Hanselman follow the link.

Thanks Guys !

Doga

Tags: , ,

.NET Framework 3.5 goes open source

by UnquaLe 4. October 2007 18:41

ScottGu posted about that and says his team has been working to enable ability for .NET developers to download and browse the source code of the .NET framework. So Visual Studio .NET 2008 will be delivered with source code(With source file comments included). That is really big feature that lets .Net developers to debug inside a .NET Framework class.

Click here and read the full Scott post! There are some great images on his post that will make us to dream within the final release.

To learn more about our source release plans and how the above debugger integration works, please check out this Podcast that Scott Hanselman and Shawn Burke recently recorded.  Shawn (who drove the source project on my team) is also going to be publishing a cool Channel9 video later this week that shows using the VS 2008 integrated debugging support with it.

Doga 

Tags: ,

C# 3.0 Orcas Language Features - Automatic Properties

by UnquaLe 1. October 2007 21:42

If you are developer you are probably quite used to writing classes with properties.

public class Customer
{
    private string firstname;
    public string Firstname
    {
        get { return firstname; }
        set { firstname = value; }
     }
}

 

This is a simple property and there is no logic in the getter and setter of the property. With new coming up C# 3.0 compiler provides short way to use properties with Automatic Properties feature.

When you are using C# 3.0 you can make your classes more concise, For example;

public class Customer
{
    public string Firstname { get; set; }
}

 

Yeah ! I know its cool to write a property in a line ;)

C# 3.0 Compiler will automaticly generate private fields in your class and implement a public getter / setter property implementation to it.

Bart De Smet has a great write-up on what happens under the covers when using automatic properties with the March CTP release of "Orcas".  You can read his excellent blog post on it here.

Tags: ,

Getting Started with Expressing Blend and WPF

by UnquaLe 24. September 2007 19:38

There are outstanding set of free videos that you can watch to learn how to get started with Expression Blend and WPF.  Click here to access to videos.

Tags: