• Wriju's BLOG

    Visual Studio Team System Chat – July 3rd

    • 0 Comments

    Join members of the Visual Studio Team System product group to discuss features available in Visual Studio Team Foundation Server, Team Editions for Architects, Developers, Database Pros, and Testers. In addition, discuss what's new in the upcoming Orcas CTP.

    We will be holding two sessions:

    Join the chat on Tuesday, July 3rd , 2007 from 10:00am - 11:00am Pacific Time. Add to Calendar | Additional Time Zones

    -or-

    Join the chat on Tuesday, July 3rd, 2007 from 4:00pm - 5:00pm Pacific Time. Add to Calendar | Additional Time Zones

    Namoskar!!!

  • Wriju's BLOG

    ADO.NET Entity Framework June 2007 CTP is available

    • 1 Comments

    Overview

    This CTP contains updates to the ADO.NET Entity Framework since the Visual Studio Codename "Orcas" Beta 1 release, including changes in Object Services, Query, Entity Client, and the Entity Data Model Wizard in Visual Studio. Some of the new features include IPOCO, detaching from long-running ObjectContext instances, multiple entity sets per type, support for referential integrity constraints, span support, transactions, serialization, no more default constructors in code-generated classes, improvements to stored procedure support, access to the underlying store connection, directory macros in the entity connection string to support hosted scenarios, native SQL read-only views, UNICODE support in Entity SQL, query plan caching, and canonical functions in Entity SQL.

     

    Samples are http://www.codeplex.com/adonetsamples/

     

    Refer for more at http://blogs.msdn.com/adonet/archive/2007/07/02/ado-net-entity-framework-june-2007-ctp-now-available.aspx

     

    Namoskar!!!

  • Wriju's BLOG

    LINQ: Query to SQL, XML and Object and JOIN them

    • 10 Comments

    Getting data from SQL, XML and Object and joining them using Language Integrated Query is something you might be looking for. I have created a small application which brings data from SQL Server (table name is Employee), XML (file name is Department.xml) and Object (Generic list containing list of Managers).

     

    My SQL Table Looks like

     

    EmpId           int     

    EmpName      varchar(50)

    DeptId          int

    ManagerId     int

     

    Now the DeptID is linked to an XML file (where the department name is assigned against DeptId is that file)

     

    <?xml version="1.0" encoding="utf-8" ?>

    <Departments>

      <Department id="1" name="Software"></Department>

      <Department id="2" name="Service"></Department>

      <Department id="3" name="Support"></Department>

    </Departments>

     

    And to get the XML data from the file located at C:\XMLData you need

     

    public static List<Departments> GetDepartments()

    {

        //Loading the XML file and storing it in List of type Departments

    var query = from e in XElement.Load(@"C:\XMLData\Department.xml").Elements("Department")

                    select new Departments

                   {

                       DeptID = (int)e.Attribute("id"),

                       DeptName = (string)e.Attribute("name")

                   };

     

        return query.ToList();

    }

     

     

     

    Manager id is also like that and it has details in Generic List.

     

    List<Managers> mgrs = new List<Managers>

    {

        new Managers{ManagerId = 1, ManagerName = "Manager 1"},

        new Managers{ManagerId = 2, ManagerName = "Manager 2"}               

    };

     

    Now for each of the three entities I have object representation in my code,

     

    /*

    Class for the XML data coming from physical file

    Using the Automatic feature

    */

    public class Departments

    {

        public int DeptID{get;set;}

        public string DeptName{get;set;}

    }

     

    /*

    Class for the Linq to Sql

    Table is in SQL Express 2005 Database "Northwind"

    Attributes are coming from the namespace "System.Data.Linq.Mapping"

    */

    [Table(Name="Employee")]

    public class Employees

    {

        [Column]

        public int EmpId { get; set; }

        [Column]

        public string EmpName { get; set; }

        [Column]

        public int DeptId { get; set; }

        [Column]

        public int ManagerId { get; set; }

    }

     

    /*

    This class is for the pure C# List<Managers>   

    */

    public class Managers

    {

        public int ManagerId { get; set; }

        public string ManagerName { get; set; }

    }

     

    Now you have to join them to get the linked data. Linq comes into the picture to help you out in this scenario.

     

    static void Main(string[] args)

    {

        //Connection string for the Linq to Sql

        string sConn =

           @"Data Source=.\SQLEXPRESS;Initial Catalog=Northwind;

                                                 Integrated Security=True";

     

        //Initializing the connection

        DataContext db = new DataContext(sConn);

       

        var query =

            from emp in db.GetTable<Employees>().ToList()

            join dep in GetDepartments() on emp.DeptId equals dep.DeptID

            join mgr in GetManagers() on emp.ManagerId equals mgr.ManagerId

                    select new

                           {

                               EmpName = emp.EmpName,

                               DeptName = dep.DeptName,

                               ManagerName = mgr.ManagerName

                           };

     

        foreach (var res in query)

        {

            Console.WriteLine("Name={0}, Dept={1}, Manager={2}"

                               ,res.EmpName, res.DeptName, res.ManagerName);

        }

    }

     

    I have attached full source code as attached.

     

    Namoskar!!!

     

  • Wriju's BLOG

    30 years of wait and Bill kept the promise he made to his dad

    • 0 Comments

    I’ve been waiting more than 30 years to say this: “Dad, I always told you I’d come back and get my degree.” - was the first reaction when this most wanted man in the software industry received much awaited degree. It took 30 odd years for conventional education system to understand the potential of a unconventional brain. This man helped millions to enrich their potential. Read out the speech here.

    photo

    Full story, I wish I also would have done something similar during my college days.

    Namoskar!!!

  • Wriju's BLOG

    MIX 2008 : Las Vegas at Hotel Casino

    • 0 Comments

    MIX 2008 is happening at Las Vegas on March 5-7, 2008, so be ready and start packing

    MIX08 is coming

    http://visitmix.com/

    Namoskar!!!

  • Wriju's BLOG

    Enterprise Architecture at MSDN

    • 2 Comments

    Want to be an Architecture? Do not miss the resources at MSDN.

    Find the resources at http://msdn2.microsoft.com/en-us/architecture/bb469938.aspx

    Namoskar!!!

  • Wriju's BLOG

    Mike Woodring's .NET Sample Page

    • 0 Comments

    C# Samples are here

    Namoskar!!!

  • Wriju's BLOG

    2008: Microsoft will rule

    • 3 Comments

    Be ready from 2008. Set of products from Microsoft are releasing then.

     

    Windows Server 2008

    SQL Server 2008

    Visual Studio 2008 are the few names and so many other related technologies based on these major products.

     

    So be ready and start upgrading yourself. Browse MSDN/TechNet and know more about these products. Talk about these products and impress your boss. Be the boss of technology at your workplace. Blog these products. Enjoy.

     

    Namoskar!!!

     

     

  • Wriju's BLOG

    C# 3.0 is 100% backward compatible with C# 2.0

    • 2 Comments

    It’s a statement that C# 3.0 supports each and everything of C# 2.0. It was required to maintain the C# standard. But lot of ground work has been done in terms of bringing the level of abstraction and set of new keywords in C#. Now the question is if you have set of new keywords which were not there in C# 2.0, how the old code will get compiled? What will happen if someone has used them as variable in their code? Yes, it works. The same keyword works as variable name as well as keyword compiling itself as first class native statement. Below is the classic example I demonstrate in my demos, (believe me this code compiles in Orcas Beta 1)

     

    using System;

    using System.Collections.Generic;

    using System.Linq;

    using System.Text;

     

    namespace CSharp3Demo

    {

        class Program

        {

            static void Main(string[] args)

            {

                //Array of integers

                int[] arrInt =

                    new int[] { 1,2,3,4,5,6,7,8,9,10 };

     

                //Use of the variable names using the keywords

                //"from", "where", "select"

                string from = "This is the kw from";

                string where = "This is the kw where";

                string select = "This is the kw select";

     

                //print the "from" variable

                Console.WriteLine(from);

                //print the "where" variable

                Console.WriteLine(where);

                //print the "select" variable

                Console.WriteLine(select);

     

                //Query Expression

                //To find the even numbers

                //Use of the keyword "from", "where", "select"

                IEnumerable<int> evens = from evenInt in arrInt

                            where evenInt % 2 == 0

                            select evenInt;

     

                foreach (int i in evens)

                {

                    Console.WriteLine(i);

                }           

            }

        }

    }

     

    Comment if you have any query. Let us know if anything which was working with C# 2.0 but not in C# 3.0. We value your feedback.

     

    Namoskar!!!

  • Wriju's BLOG

    Visual C# 2005 Default Shortcut Keys

    • 3 Comments

    This is one of the articles I wanted to write long back. May be it is not too late. These shortcut keys helps us to make our life easy..

    Visit http://msdn2.microsoft.com/en-us/library/ms366739(VS.80).aspx

  • Global Shortcut Keys, Visual C# 2005 Scheme

  • HTML Designer Shortcut Keys, Visual C# 2005 Scheme

  • XML Designer Shortcut Keys, Visual C# 2005 Scheme

  • Control Manipulation Shortcut Keys, Visual C# 2005 Scheme

  • Debugging Shortcut Keys, Visual C# 2005 Scheme

  • Search and Replace Shortcut Keys, Visual C# 2005 Scheme

  • Data Shortcut Keys, Visual C# 2005 Scheme

  • Text Navigation Shortcut Keys, Visual C# 2005 Scheme

  • Text Selection Shortcut Keys, Visual C# 2005 Scheme

  • Text Manipulation Shortcut Keys, Visual C# 2005 Scheme

  • Window Management Shortcut Keys, Visual C# 2005 Scheme

  • Integrated Help Shortcut Keys, Visual C# 2005 Scheme

  • Object Browser Shortcut Keys, Visual C# 2005 Scheme

  • Macro Shortcut Keys, Visual C# 2005 Scheme

  • Tool Window Shortcut Keys, Visual C# 2005 Scheme

  • Project Shortcut Keys, Visual C# 2005 Scheme

  • Image Editor Shortcut Keys, Visual C# 2005 Scheme

  • Dialog Editor Shortcut Keys, Visual C# 2005 Scheme

  • Refactoring Shortcut Keys, Visual C# 2005 Scheme

  • Managed Resources Editor Shortcut Keys, Visual C# 2005 Scheme

  • Code Snippet Shortcut Keys, Visual C# 2005 Scheme

  • Class Diagram Shortcut Keys, Visual C# 2005 Scheme

  • Bookmark Window Shortcut Keys, Visual C# 2005 Scheme

  • Accelerator and String Editor Shortcut Keys, Visual C# 2005 Scheme

  • Namoskar!!!

  • Wriju's BLOG

    Surface Computing

    • 1 Comments

    Use your restaurant table to give order. Put your credit card in the table for payment. Once you are in business meeting and both of you are carrying blue-tooth enabled mobile phones can share your business data. All in your good old normal table with abnormal activities.

    Surface Computing by Microsoft.

    image

    Visit for more

    http://www.microsoft.com/surface/

    Namoskar!!!

  • Wriju's BLOG

    Moving from Orcas CTP to Orcas Beta 1

    • 3 Comments

    If you have Orcas March 2007 CTP and you want to upgrade it to Orcas Beta 1, there are couple of things to be taken care. Those are well documented in MSDN and you need to clean all the CTP related installation to enjoy the smooth installation. Components which could create problems are,

    1. Remove "Microsoft SQL Server Compact Edition 3.5".
    2. Remove "Microsoft SQL Server Compact Edition 3.5 Design Tools".
    3. Remove "Microsoft SQL Server Compact Edition 3.5 for Devices".
    4. Remove "Microsoft Visual Studio Performance Collection Tools".
    5. Remove "Windows Mobile 5.0 SDK R2 for Pocket PC".
    6. Remove "Windows Mobile 5.0 SDK R2 for Smartphone".
    7. Remove "Windows SDK NetFX Tools".
    8. Remove "Windows SDK Win32 Tools".
    9. Remove "Windows SDK Headers and Tools".
    10. Remove "Windows SDK Tools".
    11. Remove "Crystal Reports 2007".
    12. Remove "Visual Studio Asset System".
    13. Remove "Visual Web Developer Design Service Reminder Tools".
    14. Remove "Microsoft Visual Studio 2005 Tools for the 2007 Microsoft Office System Runtime Language Pack". This step is not required if you have only the English edition.
    15. Remove "Microsoft Visual Studio 2005 Tools for the 2007 Microsoft Office System Runtime Language Pack".
    16. Remove "Microsoft Visual Studio Codename Orcas Tools for Office Runtime".
    17. Remove "Microsoft Visual Studio Codename Orcas Professional" or other related Visual Studio IDE installations, such as Professional, Standard, Enterprise Architect, or Team Suite.
    18. Remove "Microsoft Document Explorer".
    19. Remove "Microsoft Document Explorer 2005 Language Pack". This step is not required if you have only the English edition.
    20. Remove "Microsoft Device Emulator 3.0".
    21. Remove "Microsoft .Net Compact Framework 2.0 SP1".
    22. Remove ".Net Framework 2.0 SDK".
    23. Remove "Microsoft Visual Studio Codename Orcas Remote Debugger".
    24. Remove "Microsoft Visual Studio 64bit Prerequisites Beta". This step is required only if Visual Studio is installed on a 64-bit computer.
    25. Remove "Microsoft .Net Framework 3.5".

    Please find other related issue here. Hope for the enjoyable upgrade.

    Namoskar!!!

  • Wriju's BLOG

    C# 3.0 and its major design changes for LINQ

    • 0 Comments

    C# 3.0 PM Anson Horton discussed about the LINQ and its impact on C# 3.0 covering

    • Lambda Expressions
    • Extension Methods
    • Anonymous Types
    • Implicitly Typed Local Variables
    • Object Initializers
    • Query Expressions

    Visit the MSDN Magazine article at http://msdn.microsoft.com/msdnmag/issues/07/06/CSharp30/

    Namoskar!!!

  • Wriju's BLOG

    MSDN has got a new look and Live.com search integration

    • 0 Comments

    For more please visit http://msdn2.microsoft.com/en-us/bb457197.aspx

    Namoskar!!!

  • Wriju's BLOG

    .NET Framework: Understanding Green Bits and red Bits

    • 1 Comments

    In lots of articles about .NET Framework 3.0/3.5 you might find the term called Green bits or Red bits. What is that all about? Must read this article to understand the architecture,  http://www.danielmoth.com/Blog/2007/06/net-framework-35.html 

    Let's also use the picture from that blog

    Namoskar!!!

  • Wriju's BLOG

    ADO.NET Features and Future (SqlDataSourceEnumerator)

    • 1 Comments

    I have planned to dedicate some of my posts on ADO.NET and its future. I planned on the writing posts on new features of ADO.NET 2.0 and then slowly move to the LINQ and Entity Framework.

    Lets start with the features one by one, today I am going to talk about the cool feature on the “Server Enumeration”. This helps us to find out the list of available servers from our local network accessible to us. The small piece of code the does the magic,

     

    DataTable dt = new DataTable("NewTab");

     

    //Gets the List of available SQL databases in DataTable

    dt = SqlDataSourceEnumerator.Instance.GetDataSources();

     

    This is really helpful when you create utility tool for quick data access.

     

    Namoskar!!!

     

     

  • Wriju's BLOG

    ADO.NET Samples for Visual Studio Code Name "Orcas" - October CTP

    • 0 Comments

    Samples are available http://www.microsoft.com/downloads/details.aspx?familyid=c14c451d-7043-44f0-87d7-845f1c238d64&displaylang=en

    Namoskar!!!

  • Wriju's BLOG

    Linq Performance

    • 2 Comments

    LINQ is powerful, the internal algorithm has got the power for fine tuning and PLinq is in the pipeline. That means if you will have automatic implementation of parallel LINQ for multi-core processors. Two famous quotes from Anders Hejlsberg are

     

    "With PLinq, effectively you write the code the same way, but we arrange for it to run on multiple CPUs”

     

    "It doesn't necessarily mean that every program is going to run six times faster, but there are classes of programs that we can make run faster without the user having to get into the nitty-gritty business of writing concurrent constructs,"

     

    http://www.eweek.com/article2/0,1895,2009167,00.asp

     

    Things to remember

    +++++++++++++

     

    Ø       When you will work with different set of objects and join them in your query, you have to be very careful. Especially when one of the sources is live webservice. Then the join will every time go to the WebService and create the IEnumerable<T> (the out put).

     

    Ø       While working with Linq to SQL, there are very few areas where you can fine tune the query. Rather you might be very comfortable writing super fast queries in SQL. You have no idea how Linq to SQL will create the SQL queries which will be sent to SQL Server. But you can check the outgoing SQL queries through DataContext class or Orcas debugger. I would suggest you to use stored procedure to make sure your query is super fast and well executed.

     

    Ø       Sometimes differed loading is not the accepted behavior. As it executes the query multiple times (per master data). Let’s say the scenario of Customer an Order where each customer has multiple orders. If you run a nested for loop for each customer then the query will be created and executed every time. So we have to be very careful again here if we want to avoid the differed loading by using the DataShape class.

     

    Namoskar!!!

  • Wriju's BLOG

    SQL Server 2008 (Katmai) I am proud user

    • 0 Comments

    Yes, I have installed SQL Server 2008 (aka Katmai) Dev Edn. Few things for successful installation,

    • Better use newly formatted machine
    • Make sure that you have IIS installed (otherwise it will fail to install Reporting Service)

    Everything works perfectly fine.

    Namoskar!!!

  • Wriju's BLOG

    SQL Server 2008 (Katmai) June CTP Released

    • 1 Comments

    sql2008

    Related resources, 

  • Read the SQL Server 2008 Datasheet
  • SQL Server 2008 Product Overview
  • Watch the TechEd SQL Server 2008 Webcast
  • Download the latest release

    And may more such exciting at Tech Ed 2007.

    TE2007_Logo_TEMP

    http://virtualteched.com/Pages/OnlineSessions/OnlineWebcastsDefault.aspx

    Namoskar!!!

  • Wriju's BLOG

    Visual Studio Orcas Samples

    • 0 Comments

    C# LINQ Samples and content for Beta 1

    VB LINQ Samples for Beta 1

    Namoskar!!!

  • Wriju's BLOG

    ASP.NET 2.0 Membership, Roles, and Profile

    • 2 Comments

    From 4GuysFromRolla

    This article is one in a series of articles on ASP.NET 2.0's membership, roles, and profile functionality.

  • Part 1 - learn about how the membership features make providing user accounts on your website a breeze. This article covers the basics of membership, including why it is needed, along with a look at the SqlMembershipProvider and the security Web controls.
  • Part 2 - master how to create roles and assign users to roles. This article shows how to setup roles, using role-based authorization, and displaying output on a page depending upon the visitor's roles.
  • Part 3 - see how to add the membership-related schemas to an existing database using the ASP.NET SQL Server Registration Tool (aspnet_regsql.exe).
  • Part 4 - improve the login experience by showing more informative messages for users who log on with invalid credentials; also, see how to keep a log of invalid login attempts.
  • Part 5 - learn how to customize the Login control. Adjust its appearance using properties and templates; customize the authentication logic to include a CAPTCHA.
  • Part 6 - capture additional user-specific information using the Profile system. Learn about the built-in SqlProfileProvider.
  • Part 7 - the Membership, Roles, and Profile systems are all build using the provider model, which allows for their implementations to be highly customized. Learn how to create a custom Profile provider that persists user-specific settings to XML files.
  • Part 8 - learn how to use the Microsoft Access-based providers for the Membership, Roles, and Profile systems. With these providers, you can use an Access database instead of SQL Server.
  • Namoskar!!!

  • Wriju's BLOG

    Linq to SQL: Writing clean code

    • 2 Comments

    As you know with Orcas Beta 1 we have Linq to SQL template available. There we can drag and drop any database table and the code will be ready for you to use. What if you are not a wizard addicted like me and wants to write your own clean code?

     

    I love the conciseness of the C# 3.0 and the lesser code strategy. Let’s try to write some clean code which will allow us to use the relationship also. I will use Northwind and will use Products and Category table. But I am interested in only few selected columns

     

    Products

    ++++++

    ProductId

    ProductName

    CategoryID

    UnitPrice

     

    Category

    ++++++

    CategoryID

    CategoryName

     

    I will write my own Linq to SQL code and use my own mapping. You always need to use two major namespaces

     

    using System.Data.Linq;

    using System.Data.Linq.Mapping;

     

    I will create a mappings between my class property and SQL columns. For that I need to use couple of attributes. Let’s try that out

     

    #region Products Class

    [Table(Name="Products")]

    public class Products

    {

        [Column(IsPrimaryKey=true)]

        public int ProductId{get;set;}

     

        [Column]

        public string ProductName { get; set; }

     

        [Column]

        public int CategoryID { get; set; }

     

        [Column]

        public decimal UnitPrice { get; set; }

    }

    #endregion

     

    #region Categories Class

    [Table(Name = "Categories")]

    public class Categories

    {

        [Column(IsPrimaryKey = true)]

        public int CategoryID { get; set; }

     

        [Column]

        public string CategoryName { get; set; }

    }

    #endregion

     

     

    Now I am ready to go.

     

    Let’s suppose I have one console application, so the code will look like,

     

    static void Main(string[] args)

    {

        DataContext db = new DataContext

    (@"Data Source=BLR2B03-A\SQLEXPRESS;Initial Catalog=Northwind;");

     

        var products = db.GetTable<Products>();

        var categories = db.GetTable<Categories>();

     

        var q = from p in products

                join c in categories

      on p.CategoryID equals c.CategoryID                   

                select new { p.ProductName, c.CategoryName };

       

        ObjectDumper.Write(q);

     

    }

     

    That’s all. Isn’t it much cleaner code? Happy weekend.

     

    Namoskar!!!

  • Wriju's BLOG

    Linq: Why and Its Contemporary

    • 1 Comments

    Why LINQ (or other components of Linq). One of the major reasons is that to address the mismatch between relational data domain and object domain. Database was more comfortable for developers from SQL world and they were no where in object domain.

    Please visit Comparing LINQ and Its Contemporaries for more details.

    Namoskar!!!

  • Wriju's BLOG

    Performance in C#

    • 0 Comments

    When we consider managed code in our application we also have to think about the performance. .NET has its own way of fine tuning things but just by remembering couple of things we can prevent the unnecessary push backs from our end.

    One of the biggest concerns is that why Generics? It is strongly typed, it is type safe. Because of this it also reduces unnecessary Boxing and Unboxing which can be memory intensive. Another thing is that because of snippet feature just by typing ~ we can put destructor in our class and if there is nothing in the body of destructor, the natural life cycle of garbage collector may get hampered.

    Such tips and tricks are available in MSDN

  • Writing Faster Managed Code: Know What Things Cost

  • Writing High-Performance Managed Applications : A Primer

  • Garbage Collector Basics and Performance Hints

  • Performance Tips and Tricks in .NET Applications

  • Hope this will be helpful.

    Namoskar!!!

    Page 22 of 25 (618 items) «2021222324»