Horizontal Nav

Friday, 18 July 2014

Two Major Elements of Project Scope

Defining scope is perhaps the most important part of the initial definition and planning process. If you don’t know what you are delivering and what the boundaries of the project are, you have no chance for success. If you have not done a good job of defining scope, managing scope will be almost impossible.
Most people understand what scope means, but many struggle trying to actually define the scope of a project. It is easiest if you remember there are two major aspects of defining scope on your project – deliverables and boundaries.
·  The deliverables. All projects produce deliverables. (These are sometimes called the "products" produced by the project.) Even if you are not sure what else to include in your scope definition, you should always include your deliverables. Understanding the deliverables you are building goes a long way to understanding the scope of the project. There are many deliverables that could be listed, but you should focus on the final deliverables of the project - not necessarily the internal deliverables produced as a part of delivering the final solution.  
·  Project boundaries. The scope boundary statements are used to define what is within the boundaries of the project and what is outside those boundaries. The more boundaries you can identify, the better off your project will be. You would not need to state that some aspect of the project was in-scope unless you could also contrast that with some aspect that is out of scope. The nature of a true boundary statement is that there is both an in-scope and a relevant out-of-scope counterpart. For example.  
o        The major life-cycle processes that are in scope and out of scope. For instance, your project may include the Analysis Phase only and not the Design, Construct or Test Phases. Or perhaps your project is performing research, but you are not going to develop the results. These would be examples of using boundary statements to clearly state what your project is responsible for, and what is out of scope. 
o        The organizations that are in scope and out of scope. In some cases, the organizations involved in the project help to define the boundaries. For instance, your project may be applicable to the Human Resources and Accounting Departments, but the Manufacturing Division might be out of scope. Or perhaps your project is only impacting the corporate office while the field offices are out of scope.
o        The major functionality that is in scope and out of scope. This might be a good boundary if you were delivering less than full functionality. For instance, decision support and management reporting might be in scope, while overnight batch processing might be out of scope. Or perhaps financial reporting is in-scope for your project, but Human Resources reporting is out of scope.
What do you need to remember? First - scope is defined as deliverables and boundaries. Deliverables are the things you build during the project. Boundaries are statements that describe the project in terms of in-scope and out-of-scope. 
..................................................
Define and manage scope on your project - plus much more. Get your project started quickly with a pre-built set of great project management templates

How to Work More Effectively

With more teams working in different offices, travelling and working at home these days, the chances are that some of your team members don't work in the same building as you from time to time. This can present a challenge: how can you work with them when you can't meet them physically?
Online collaboration tools are the easiest way to work effectively with people on a project, wherever you are. There are even benefits if you are all based in the same office space. So here are 5 tips to help you...
Tip 1: Keep all your discussions online
One of the most effective ways of working is to move everything online. Online collaboration software can help you do this, as it is designed for running projects on the web. The benefit of having all your project information and discussions online is that everyone can see the latest status at any time. You can even move your emails online into the software that you are using so that the whole discussion trail is in one place.

Tip 2: Use instant messaging
Instant messaging is great for getting the answer to a quick question, or checking if one of your colleagues is available for a longer discussion. You can archive your messaging trail securely online so that if you need to refer to it later it's there in your project files. It's faster and easier than email and once you start using it you'll never look back.

Tip 3: Share pictures
Do you know what all your team members look like? That might sound like a silly question, but if you are working with colleagues overseas or even in a different office, you may never have met them. Even if you have met them, chances are someone on your team has only ever talked to them on the phone. Upload photos to your team area so that you can see each other. It's easier to collaborate if you can put a face to a name!

Tip 4: Upload files
Stop sending huge email attachments by uploading all your core project files to a central online location. Using a document repository like this means that everyone always has access to the latest version, which can be a massive time-saver. It also means that people don't get frustrated looking for the latest copy and your IT department will be very happy that you aren't using your inbox as a document store!

Tip 5: Share calendars
It can be difficult to collaborate with team members if you don't know where they are. Sharing calendars means you can check if they are on leave or out of the office, and schedule meetings appropriately. You can also put key project milestones in the calendar so that everyone knows what is coming up without having to look at the project schedule. Make sure that you keep your own calendar up-to-date as well and include all the national holidays that are appropriate for your international team members, so you know when their offices are likely to be closed.

Using the collaboration features of ProjectManager.com is the easiest way to work effectively with your project team. Start discussions, share files, allocate tasks to each other and use instant messaging. As it is all online, you can store the conversations securely in your project files.

Tuesday, 15 July 2014

How to Use XML File to Store Data and Retrieve Data Using ASP.Net With C#

Introduction: This article explains how to use a XML file to store and retrieve data dynamically using ASP.NET with C#.  This article will also help to create child nodes in a XML file using ASP.NET. 
Use the following procedure to create a simple application (BookStore) for storing data to and retrieving data from a XML file.

Step 1: Create an ASP.NET project add one web web form and add the following controls:


Control Id
Control
Purpose
tbTitle TextBox Control To enter the title of the book.
tbAuthor TextBox Control To enter the Author Name of the book.
tbYear TextBox Control To enter the publishing year of the book.
tbPrice TextBox Control To enter the price of the book.
btnSubmit Button Control To Submit the data.
gvBookStoreRecords GridView Control To display data of XML File


I have designed my aspx page like as in the following:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>  
<!DOCTYPE html>  
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title></title>  
    <style type="text/css">  
        .auto-style1 {  
            text-align: right;  
            width: 75px;  
        }  
    </style>  
</head>  
<body>  
    <form id="form1" runat="server">  
        <div>  
            <br />  
            <table style="width: 100%;">  
                <tr>  
                    <td class="auto-style1">Title:</td>  
                    <td>  
                        <asp:TextBox ID="tbTitle" runat="server"></asp:TextBox>  
                    </td>  
                </tr>  
                <tr>  
                    <td class="auto-style1">Author:</td>  
                    <td>  
                        <asp:TextBox ID="tbAuthor" runat="server"></asp:TextBox>  
                    </td>  
                </tr>  
                <tr>  
                    <td class="auto-style1">Year:</td>  
                    <td>  
                        <asp:TextBox ID="tbYear" runat="server"></asp:TextBox> 
                    </td>  
                </tr>  
                <tr>  
                    <td class="auto-style1">Price:</td>  
                    <td>  
                        <asp:TextBox ID="tbPrice" runat="server"></asp:TextBox>  
                    </td>  
                </tr>  
                <tr>  
                    <td class="auto-style1"> </td>  
                    <td>  
                        <asp:Button ID="btnSubmit" runat="server" Text="Submit"  />  
                    </td>  
                </tr>  
            </table>  
            <asp:GridView ID="gvBookStoreRecords" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None">  
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />  
                <EditRowStyle BackColor="#999999" />  
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />  
                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />  
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />  
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />  
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />  
                <SortedAscendingCellStyle BackColor="#E9E7E2" />  
                <SortedAscendingHeaderStyle BackColor="#506C8C" />  
                <SortedDescendingCellStyle BackColor="#FFFDF8" />  
                <SortedDescendingHeaderStyle BackColor="#6F8DAE" />  
            </asp:GridView>  
        </div>  
    </form>  
</body>  
</html>

And as in the code above I designed the page as in the following:




Step 2: Add an XML file within the project solution, provide it the name BookStore.xml. Create a root node in it as in the following:

<?xmlversion="1.0"encoding="utf-8"?>  
<bookstore>  
  
</bookstore>
  
Step 3: On the click event of the btnSubmit (Button that we have placed at aspx page) write the following code:

protected void btnSubmit_Click(object sender, EventArgs e)
{  
    // creating object of XML DOCument class  
    XmlDocument XmlDocObj = new XmlDocument();  
    //loading XML File in memory  
    XmlDocObj.Load(Server.MapPath("BookStore.xml"));  
    //Select root node which is already defined  
    XmlNode RootNode = XmlDocObj.SelectSingleNode("bookstore");  
    //Creating one child node with tag name book  
    XmlNode bookNode = RootNode.AppendChild(XmlDocObj.CreateNode(XmlNodeType.Element, "book"""));  
    //adding node title to book node and inside it data taking from tbTitle TextBox  
      
    bookNode.AppendChild(XmlDocObj.CreateNode(XmlNodeType.Element, "Title""")).InnerText = tbTitle.Text;  
    //adding node Author to book node and inside it data taking from tbAuthor TextBox  
    bookNode.AppendChild(XmlDocObj.CreateNode(XmlNodeType.Element, "Author""")).InnerText = tbAuthor.Text;  
    //adding node Year to book node and inside it data taking from tbYear TextBox  
    bookNode.AppendChild(XmlDocObj.CreateNode(XmlNodeType.Element, "Year""")).InnerText = tbYear.Text;  
    //adding node tbPrice to book node and inside it data taking from tbPrice TextBox  
    bookNode.AppendChild(XmlDocObj.CreateNode(XmlNodeType.Element, "Price""")).InnerText = tbPrice.Text;  
  
    //after adding node, saving BookStore.xml back to the server  
    XmlDocObj.Save(Server.MapPath("BookStore.xml"));  
  
    //Calling grid view binding method.  
    gridDataBind();  
}  

Step 4: Create a gridDataBind Method to retrieve the data from the XML file:

public void gridDataBind()    
    {    
        DataSet ds = new DataSet();    
        //reading data from the BookStore.xml...    
        ds.ReadXml(Server.MapPath("BookStore.xml"));    
        //Adding dataset ds as a datasource of the grid view...    
        gvBookStoreRecords.DataSource = ds;    
        //binding data with grid view...    
        gvBookStoreRecords.DataBind();    
    }
     
Step 5: Now run the project and you will see the following outputs:

  1.  When the project loads the first time then:


After adding some data:





C# SqlDataReader

SqlDataReader reads database rows one-by-one. It reads in forward order from an SQL database. The SqlDataReader type can be used in a loop to read multiple rows from an SQL database. It provides good performance and strong typing.


Example

Preliminary steps are required before using SqlDataReader on a database table. These steps require configuration on your part. You must target the correct database with a custom connection string and also target the proper table.

To begin, you can create a new SqlConnection and open it. Then you can create a new SqlCommand and call its ExecuteReader method, assigning the reference it returns to an SqlDataReader.

Program that uses SqlDataReader with SqlClient: C#
using System;

using System.Data.SqlClient;
class Program

{

    static void Main()

    {

       //

       // You need to access the project's connection string here.

       //



       string connectionString = ConsoleApplication1.Properties.Settings.Default.ConnectionString;
       //

       // Create new SqlConnection object.

       //
       using (SqlConnection connection = new SqlConnection(connectionString))

       {

           connection.Open();
           //

           // Create new SqlCommand object.

           //
           using (SqlCommand command = new SqlCommand("SELECT * FROM Dogs1", connection))

           {
              //

              // Invoke ExecuteReader method.

              //
              SqlDataReader reader = command.ExecuteReader();

              while (reader.Read())

              {

                  int weight = reader.GetInt32(0);    // Weight int

                  string name = reader.GetString(1);  // Name string

                  string breed = reader.GetString(2); // Breed string
                  //

                  // Write the values read from the database to the screen.

                  //
                  Console.WriteLine("Weight = {0}, Name = {1}, Breed = {2}",weight, name, breed);

              }

           }

       }

    }

}
Output
Weight = 57, Name = Koko, Breed = Shar Pei
Weight = 130, Name = Fido, Breed = Bullmastiff
Weight = 93, Name = Alex, Breed = Anatolian Shepherd Dog
Weight = 25, Name = Charles, Breed = Cavalier King Charles Spaniel
Weight = 7, Name = Candy, Breed = Yorkshire Terrier

Access connection string. Main() first accesses a project-specific ConnectionString. Your project will have its own ConnectionString, which can be generated through the Add Data Source menu item in Visual Studio.

Tip:You must always create a new SqlConnection before using the SqlDataReader code here.

Note:SqlConnection objects use an advanced optimization called connection pooling.

So:Creating these new objects will probably not have a highly adverse affect on overall program performance.

Next, you must create a new SqlCommand object with an SQL text query as its first parameter, and the SqlConnection object reference as its second parameter. This program does not use a stored procedure, which may reduce performance.

Note:The text "SELECT * FROM Dogs1" simply selects all rows from a table called Dogs1 in the database.

Finally, the program creates a new SqlDataReader object from the result of the ExecuteReader() method. The while-loop continues iterating through its loop body as long as the Read() method does not return false.

Tip:This makes it possible to query the SqlDataReader for integers, strings and other types with the GetInt32 and GetString methods.

SqlDataAdapter

A more object-oriented approach to database table reading can be achieved by using DataTables. You can directly populate a DataTable with the data from an SQL database table using the SqlDataAdapter class.

Warning:This approach is slower if you are dealing with vast amounts of data, because all of it must be stored in memory at once.

Summary

We saw the SqlDataReader class. It provides an excellent way to query rows one-by-one from your database tables. It does not require the usage of a DataTable, which can improve performance and decrease memory usage in certain cases.

Tip:Using SqlDataReader is an easy way to print all rows from a table. It is efficient and worth knowing.