.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Best method for creating ages ranges for age when someone was sick

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :Sql Server


I have a sickness Fact table, with a record for each day each employee was sick. I also have 2 dimension tables, employee and Date.

I want to create ages ranges for the age an employee has on each sick day in the fact table. I solved it by adding an age and age-range column tot the sickness fact table (difference between sickday date and birthdate). After that I created a dimension from this sickness fact table age range columns. But I think the birth date and the age ranges should not be in the fact table, so it works, but in my opinion it is not the way it should be...

So what is the best way to solve this? btw i'm using sql 2008 Standard.

Thanks in advance

View Complete Post

More Related Resource Links

Problem creating method?


I added the extender and when i tried to add the method this message poped up;

Cannot create page method "GetCompletionList" because no Code Behind or codefile was found.

does anyone know why this is happening?

Thanks  =)

Creating dynamic web controls outside Init method



I am creating a dynamic <asp:Table> based on a user's selection from a DropDownList. The number of columns and rows in the table depends on the user's choice from the DropDown.

The final two columns in each row needs to contain an Edit and Delete button. I am able to create these buttons programmatically. However, I am unable to get the click event to fire.

After researching this, it appears to be the case that my dynamic Web controls need to be created in the page Init method.

However, I am unable to do this as I do not know how many table rows, columns and buttons to create, until after the user has made a selection from a DropdownList.

I would be be very grateful for some tips on the correct way to create and enable the events for my dynamic buttons, in this scenario.

Here is a brief outline of how the program currently works (this is just a brief outline I quickly sketched, small details may be wrong!):


<asp:DropDownList ID="ddlMyDropDown" runat="server" 
                onselectedindexchanged="ddlMyDropDown_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList>

<asp:Table ID="tblMyTable" runat="server" /> 

Creating a One-Dimensional Array for use with AddUsersToRoles Method


Dear All

I've created an Excel spreadsheet for my users to upload into my web application to bulk import  memberships and roles into the application. There are up to 4 different roles which users can be members of so I'm using AddUsersToRoles to add the user to one or more roles in one line of code like this:

r.AddUsersToRoles(usernames, CreateListOfRoles(Role1, Role2, Role3, Role4))

As this line of code expects a one-dimensional array of roles, I have created a function to take in the roles from my spreadsheet, add them into a one-dimensional array, and return that to the AddUsersToRoles method. The CreateListOfRoles function looks like this:

    Function CreateListOfRoles(ByVal Role1 As String, ByVal Role2 As String, ByVal Role3 As String, ByVal Role4 As String) As Array

        Dim ar As New ArrayList

        'If the role boxes are not blank, add them to the array
        If Not String.IsNullOrEmpty(Role1) Then
        End If

        If Not String.IsNullOrEmpty(Role2) Then
        End If

        If Not String.IsNullOrEmpty(Role3) Then
        End If

        If Not String.IsNullOrEmpty(Role4) Then
        End If


error when creating a new ribbon tab and using MakeTabAvailable method

Hi there
to add a custom tab in the ribbon. After deploying my solution the tab appears fine and everything seems to be working.

What i did next was , I took the RegistrationId="101" RegistrationType="List" from the XML definisiton and called the MakeTabAvailable method as follows hoping that i can make the tab available in all lists.

protected void Page_Load(object sender, EventArgs e)
            SPRibbon ribbon = SPRibbon.GetCurrent(this.Page);
            if (!ribbon.IsTabAvailable("Ribbon.CustomTabExample"))


however after doing that, the tab appears fine, but it can't load the groups/buttons. The tab just keeps on loading and nothing is rendered. If i click on another tab, and then click on my custom tab i get the following error in the browser.

Webpage error details

Best method for creating a site definition containing a custom list instance



I want to create a new site definition which, when provisioned, includes an instance of a custom list. The custom list definition is contained in a feature as part of the site definition project. What's the best method for creating an instance of this custom list?

I can think of a few ways to do it:

- Modify the onet.xml for my site definition to include an instance of the list

- Use feature stapling to enable my custom list defintion feature when a site is provisioned using my new site definition and include a list instance in the feature.

Is there another more suitable method?



What is the best method/practice for creating a site or functionality within SP 2010 that will allow


As it stands in Visual Studio 2010 I created a new Site Definition and then created 3 new application pages (aspx with cs code behinds; i will call them a/b/c.aspx) and they were added to the 'Layouts' folder in the project.  I also added a data connection Dataset.xsd with all of my stored procedure connections. Looking at my project,  I have 3 aspx pages with cs files in the LAYOUTS folder and one single default.aspx page in the Site Definition 'object'.

If I run the project my browser opens up and navigates to the url "_layouts/[project name]/a.aspx. I can navigate to pages b.aspx and c.aspx and perform my database interactions.  The problem occurs when I then have to deploy the solution/package to the server via a wsp file.  If I deploy the project and then go to create a new site and select my newly created Site definition, SP 2010 will only display the content of the default.aspx page that was located in the site definition 'object' of my project.  All 3 of my custom application pages a/b/c.aspx are no where to be found.

My question is, how to I deploy these 3 application pages?


Any help is greatly appreciated!!!


- gabor

How to hide a method while creating custom control by inheriting WebControl?



I am creating a custom control by inheriting a server control, say LinkButton. There are properties like "BorderColor" available in LinkButton. Let's say, I don't want this particular property to be available when I create an instance of the custom control.

I want to completely hide this particular property (I don't want to override it but disable it.)

My code is as follows:

    Class MyLinkButton
        Inherits LinkButton

        'I want to hide the following method in such a way that if an object of MyLinkButton is created, the following property is not available
        Public Overrides Property BorderColor As System.Drawing.Color
                Return MyBase.BorderColor
            End Get
            Set(ByVal value As System.Drawing.Color)
                MyBase.BorderColor = value
            End Set
        End Property

    End Class

Can anyone help me with this oir provide few pointers?

HELP: Creating an ActionResult method to display a particular database record using Entity Framework


Hi All,

I have an ActionResult method that displays records from a database table (below):

namespace STD.Controllers
    public class StudentController: Controller
        StudentEntities stud;
        public StudentController()
        stud= new StudentEntities ();


        public ActionResult Index()
            ViewData.Model = stud.StudentTable.ToList();
            return View();


I want to design a method "ActionResult Student()" that accepts "Student ID" as a parameter and displays record for that particular student only.

What do I need to do to make this happen? Could anyone please help me with this?

Thanks in advance


Thinking about new C# method prototypes: object as dictionary

I recently had to write a small Flickr API. I know many .Net API for Flickr already exist but I needed one for a Silverlight application. Whatever, it's only about building some querystrings so I did it by myself. It's been an opportunity to think again about a classical question: how to pass parameters to a method ?

Imagine you have a generic method to call some Flickr functions.

Creating your SharePoint Governance Plan

One of the most common questions that I get from prospects as I'm talking to them about the creation of a governance plan and process is what does it look like. In other words, there are materials available which describe what should be in a governance plan but there isn't a ton of guidance on what the process of creating a governance plan and process are.

Creating Paging for a Repeater Control

A common question is "How do I implement paging within a Repeater?" Although the beauty of the Repeater control is its flexibility, you're on your own for building most functions. ASP.NET 2.0 has included some new controls that provide paging, as does the DataGrid in ASP.NET 1.1. However, this tip shows you how to roll your own paging for a simple data viewer.

Creating an AJAX Repeater in ASP.NET MVC

The "TaskList" is a tried an true example of the most basic thing that you can do in any framework. Unfortunately, I had some problems finding a really good example of all the steps necessary to get a task list to work in ASP.NET MVC 1.0.

Creating a Generic Entity Framework 4.0 Repository

With .NET 4.0 right around the corner, I thought it would be cool to download Visual Studio 2010 beta 2 and start playing around with the next release of Entity Framework.

The initial release of Entity Framework came with a great deal of criticism. To make matters worse, there was a large uproar when it was rumored that Microsoft would be abandoning LINQ to SQL, in favor of Entity Framework. This was because, at the time, many developers felt Entity Framework was an inferior technology to LINQ to SQL. To set things right, Microsoft proactively moved forward with improving Entity Framework, in time for the 4.0 release of the .NET Framework. This is good news because my initial impressions, so far, have been nothing but positive.

Creating a Simple Class in C#

The second article in the C# Object-Oriented Programming tutorial describes how classes are created in C# and how behaviour, in the form of publicly visible and private, hidden methods can be added. This demonstrates some of the uses of encapsulation

Creating SharePoint items with CreateItemActivity

Instead of creating new list items from code in your workflow you can use CreateItemActivity. CreateItemActivity can be used for creating list items or files. Properties of interest for this activity are the following (most of them are self-explanatory):

Creating an Excel Spreadsheet programmatically using VB.NET

The Interoperability services make it very easy to work with COM Capable Applications such as Word and Excel. This article reveals using Excel from a managed application. Excel is the spreadsheet component of Microsoft Office 2000. The majority of Excel programmatic functionality is exposed through Automation via the type library Excel9.olb. The intention of this article is to express that a managed application can interrelate with Excel as a COM server.

Creating an Excel Spreadsheet and Adding Data to It Programmatically

The Interoperability services make it veryeasy to work with COM Capable Applications such as Word and Excel. Thisarticle reveals using Excel from a managed application. Excel is thespreadsheet component of Microsoft Office 2000. The majority of Excelprogrammatic functionality is exposed through Automation via the typelibrary Excel9.olb. The intention of this article is to express that amanaged application can interrelate with Excel as a COM server.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend