studio NETSOULS

Applying Web To Your Business

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<T> to a DataTable object with the correct schema (for the primitive types) that our contained objects have.  Here's what we came up with:More...

  • Currently 4 /5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

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

  • Currently 0 /5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

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

   1: // suppose we have a enum
   2: enum PublishingStatus : short
   3: {
   4:     Draft = 1,
   5:     PendingApproval = 2,
   6:     Active = 3,
   7:     Archived = 4,
   8:     PendingDeletion = 5
   9: }
  10:  
  11: //set a default value
  12: PublishingStatusEnum CurrentPublishingStatus = PublishingStatusEnum.Draft;
  13: if (Enum.IsDefined(typeof(PublishingStatusEnum), Helper.GetShort(Reader["CurrentPublishingStatusId"])))
  14:     CurrentPublishingStatus = (PublishingStatusEnum)Enum.Parse(typeof(PublishingStatusEnum), Reader["CurrentPublishingStatusId"].ToString());
  15:  
  16: // suppose we have a string enum
  17: enum SiteColors
  18: {
  19:     Red,
  20:     Blue,
  21:     Orange
  22: }
  23:  
  24: //set a default value
  25: SiteColors SelectedColor = SiteColors.Red;
  26: if (Enum.IsDefined(typeof(SiteColors), Reader["SiteColor"].ToString()))
  27:     SelectedColor = (SiteColors)Enum.Parse(typeof(SiteColors), Reader["SiteColor"].ToString(),true);
  28: // we passed the last variable as true of ignoreCase
  • Currently 0 /5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

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...

  • Currently 0 /5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

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

  • Currently 0 /5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

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...

Tags

This will be shown to users with no Flash or Javascript.

Contact Us

My status

Quote of the Day

"Do you see a man wise in his own eyes? There is more hope for a fool than for him."

- Proverbs 26:12

NutritionVista

www.NutritionVista.com

Archives


Advertisements


Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008

Log in