studio NETSOULS

Applying Web To Your Business

Collection Helper

If you've worked on creating a Data Access Layer you know how frustrating it can be to determine the type of data your DAL will be handling. For that reason, creating a converter that works with generics or vica-versa can be the long term answer.

Alright, so for our applications we have a couple of forms that use the DataGridView control to display tabular data (kinda of a common scenario for many business applications). The data is returned from our services as an IList<T> in which we can just then bind directly to the grid by using the grid's DataSource property. Pretty easy task...unless when it comes to data manipulations.

So, what we decided to was take the easy way out and that is convert our IList&lt;T&gt; to a DataTable object with the correct schema (for the primitive types) that our contained objects have.&nbsp; Here's what we came up with: More...


If you are using SQL Server 2005 and not able to connect to it remotely, then check out this useful blog post.


I lot of times in our Business Object Model we use enums, these enum property could be a string, integer or a short value. While retrieving records from the database we need to set the property in the BOM to that of the enum value.

Here is one of those methods that you can never find when you're looking for it

// suppose we have a enum   
enum PublishingStatus : short   
{   
    Draft = 1,   
    PendingApproval = 2,
    Active = 3,   
    Archived = 4,   
    PendingDeletion = 5   
}  

//set a default value  
PublishingStatusEnum CurrentPublishingStatus = 
    PublishingStatusEnum.Draft;  
if (Enum.IsDefined(typeof(PublishingStatusEnum), 
    Helper.GetShort(Reader["CurrentPublishingStatusId"])))  
    CurrentPublishingStatus = (PublishingStatusEnum)Enum.Parse(
        typeof(PublishingStatusEnum), 
        Reader["CurrentPublishingStatusId"].ToString());  

// suppose we have a string enum  
enum SiteColors  
{  
    Red,  
    Blue,  
    Orange  
}  

//set a default value, pass the last variable as true of ignoreCase
SiteColors SelectedColor = SiteColors.Red;  
if (Enum.IsDefined(typeof(SiteColors), 
    Reader["SiteColor"].ToString()))  
    SelectedColor = (SiteColors)Enum.Parse(
        typeof(SiteColors), Reader["SiteColor"].ToString(),true); 

Keyword Analysis

Keyword research or keyword analysis is one of the more challenging aspects of search engine marketing.

Selecting the most appropriate keywords or keyword phrases a website should be optimized for is ultimately the key to successful search engine positioning. If you're not targeting the right keywords and phrases, then even the best rankings are of little value.

Selecting keywords is a balance of choosing phrases that are relevant to your website, are sufficiently popular search phrases to warrant targeting (i.e. people are actually using these search phrases) and, where possible, have a low number of competing sites.More...


PhaseOne Trials

studio Netsouls completes the design and development of a multi-lingual website with a complete content management system for PhaseOne Trails, Denmark.

About PhaseOne Trials
PhaseOneTrials A/S is a Danish Contract Research Organization (CRO) that conducts highly specialized clinical phase I trials and early phase II trials of new drug candidates.

Phase I trials include studies in which a new drug is tested for the first time in healthy humans - also known as "First-in-Man" studies. Early phase II studies, or "Proof-of-Concept" studies, include testing a drug in small groups of patients to determine whether the drug has the desired effects on a given disease.

PhaseOneTrials specializes in conducting complicated studies which are tailor-made to each customer's specific requirements. This customized process ensures optimal study results, based on data of the highest quality.

Visit: www.phaseonetrials.com


Transpose DataTable Contents

This code is useful to transpose the datatable rows and columns.

DataTable dtSource = new DataTable();   
protected void Page_Load(object sender, EventArgs e)   
{   
    // Bind the source datatable from the database   
    dtSource = dataSource();   
}   

public DataTable FlipDataTable(GridView gvNew)   
{  
    DataTable dataTable = new DataTable("dataTable");  
    
    // create column  
    DataRow newRow;  
    for (int iRow = 0; iRow < dtSource.Columns.Count; iRow++)  
    {  
        newRow = dataTable.NewRow();  
        
        newRow[0] = dtSource.Columns[iRow].ToString();  
        for (int iCol = 1; iCol <= dtSource.Rows.Count; iCol++)  
        {  
            newRow[iCol] = dtSource.Rows[iCol - 1][iRow];  
        }  
        dataTable.Rows.Add(newRow);  
    }  
}

The software development methodology does not change, whether the development is done domestically in the United States, Europe or any other part of the world.

Our team works with an industry standard software development methodology. You will be in direct communication with the project manager who will track your project through all the phases of development, from needs analysis, requirements documentation, prototyping, development, testing, release, business practice integration and support.

The work will be done in our offshore office, but through the power of the Internet and through our very strong communication skills, it will feel as though we were working right in your facility.More...


Lets suppose you have a data source in XML like:

<Settings>
    <ElementCollection>    
        <add key="SomeKey" value="SomeValue">
        <add key="SomeKey" value="SomeValue">
    </ElementCollection>
</Settings>

Now you want to edit the key and values with in the xml element collection.

<asp:XmlDataSource ID="configXmlDataSource" XPath="//add" 
    runat="server" DataFile="~/settings.config"/> 

Use the following code in the code-behind

// In this code we are getting the Data Item values 
// of the Rad Editor. On UpdateCommand Event we are getting 
// the values of data row in an instance of hash.   
GridDataItem dataItem = (GridDataItem)e.Item;    
Hashtable ht = new Hashtable();    
dataItem.ExtractValues(ht);   

// Get the node values as per the selected key name:    
XmlNode AppNode = XmlDataSource1.GetXmlDocument().SelectSingleNode
    ( String.Format("//add[@key='{0}']", key));

// Now assign the new value of the Value attribute of the 
// selected node:  
AppNode.Attributes["value"].Value = ht["value"];  

//Finally we need to update the xml source file:  
configXmlDataSource.Save();

Let's create and populate some tables so we have some data to work with. Assume you have a sales effort management (SEM) system that allows you to track the number of sales calls made on a potential client. A sales call is not a phone call, but a get together such as lunch or another type of person-to-person meeting. One of the things the VP of Sales wants to know is how many of his sales personnel participate in a call. The following tables allow you to track this information. More...


Recent Project Snapshots

  • Mary Kay - Make Over Contest
  • Utility Forms
  • Oncomed
  • Nutrition Vista
  • Forysth Barr - Letter Writer Application
  • Phase One Trials - Content Management System

About Us

studio NETSOULS is a complete IT services company, offering strategy, design, development and implementation of the total solution for your web and IT initiatives. The solutions we provide, enables businesses to leverage leading edge technology to gain sustainable competitive advantages in today's marketplace.

We specialize in designing, developing and deploying the next generation of IT solutions including e-business solutions Read more...

Month List