Jan 24 2006

The Dream - Episode 3

Category:Bil@l @ 19:45

I promised you to inform you on my dream every now and then.

I have been working on it for around 4 continious days.

I got some sickness yesterday and still till today at home because of the illness. However, nothing can and will stop me from reach the dream and making it a truth.

I consider myself still on the mid of the road, but I will arrive soon ;)

Keep an eye here!!

Regards

 

Tags:

Jan 23 2006

Provider ToolKit Configuration Utility

Category:Bil@l @ 20:51

A Code Template for Building a Provider Based Feature has been published lately on the Microsoft ASP.NET Developer Center.

This is a Provider ToolKit that gives developers a ready made template for a Provider Model for him/her to customize as the need is.

There is a readme.txt file inside the downloaded Provider ToolKit to help you configure the toolkit to make it work for your application.

If you don't want to read that readme file, then download the utility I created to configure for you that Provider toolkit.

Normally, what you have to configure in that Provider ToolKit is the:

  • Provider Name
  • NameSpace
  • Type of Provider: Microsoft Access, Microsoft Sql Server, Oracle, or MySql

In all the files accompanying the toolkit.

After confgurating that toolkit, you will have a set of classes constituting your Provider Model classes which are:

  • MyTestProvider: Which is the base class including all the abstract methods.
  • MyTestConfiguration: A class responsible to get all the configuration properties of that provider from the Web.config file.
  • MyTestProviderCollection: A class responsible to hold the configurations for each provider configured in the application inside the Web.config file.
  • (Sql-Access-MySql-Oracle)MyTestProvider: Is the concrete implementation of the methods inside the MyTestProvider.
  • Configuration Sections in the Web.config

In order for you to go through each of the above files and change the names and file names, it would take like 30 to 60 minutes to do so.

The tool I created:

All you have to do is enter the Provider Name (without the*Provider word*), enter the NameSpace (can be left empty), choose an implementation out of the 4 available.

It will do nothing but customize the Provider Toolkit as you want, so no more needed to waste the 30 - 60 minutes trying to configure the files in the Provider toolKit.

Hope this utility helps you. you can download it from the DownLoads Section of my website. I have placed both the code and the executable application.

Happy Dot Netting!

Regards

 

Tags:

Jan 23 2006

CSS 3-Column Generator

Category:Bil@l @ 18:36

I would like to share with you this cool link on how to generate a 3-column page template with CSS.

3-Column Generator

Enjoy CSSing ;)

 

Regards

 

Tags:

Jan 22 2006

Install Application Services Database on Microsoft Sql Server 2000

Category: ASP.NET 2.0 - GeneralBil@l @ 20:01

ASP.NET 2.0 ships with a set of providers for different features. We have the profile, membership, personalization and other new features that require a set of database tables and stored procedures, which are known as Application Services Database.

Usually when you create a new web application in ASP.NET 2.0 using either Visual Studio 2005 or Visual Web Developer, those tools would automatically build the database to use in either the Microsoft Sql Server 2005 or in the Microsoft Sql Express 2005.

However, if you still want to use the new features in ASP.NET 2.0 that need the database, with Microsoft Sql Server 2000, that is possible too. There is a tool called aspnet_regsql.exe that you can use in order to install the database on Microsoft Sql Server 2000.

In this post, we will go through a step by step tutorial on how to do so.

First of all, open a new comand prompt windows, go to:

{DriveLetter}:\Windows\Microsoft.Net\Framework\{Version Number}\aspnet_regsql.exe

Once you run this, the following screen is shown in front of you:

Click Next.

You have the choice to either install a new Application Services Database or remove an existing one from one of the databases you installed before. In this case we want to install new one, so choose the first option and press Next.

You will need to put your machine name instead of *Development*, it is the name of my VPC that I develop on. You can use either Windows or Sql authentication. In case you want to use Sql Authentication, then should have previously created the username and password on the database you want to install the services databased. Finally choose the database where you to install the services related database. Click Next. 

Click Next.

Click Finish.

 

Hope this tutorial helps,

 

Regards

 

Tags:

Jan 22 2006

ListControl property : AppendDataBoundItems

Category: ASP.NET 2.0 - GeneralBil@l @ 12:30

In ASP.NET 1.1, we used to bind a ListControl or any other control inheriting from it to some source of data, after that we used to add a new item at location 0 to tell the user to choose a value, like :  -- Choose a Value --

We always had to do so AFTER binding the ListControl to its data source, else the binding will remove all previous items in the ListControl.

Today, in ASP.NET 2.0, we have the ListControl's property, called AppendDataBoundItems, once this property is set to true, this tells the ListControl NOT to clear the ListControl items before binding to data, so now we can add an item on the top of the ListControl, then simply bind the ListControl to the data source we have. an example is given beloe:

this.ddlItems.Items.Add("- Choose an Item -");
this.ddlItems.AppendDataBoundItems = true;
this.ddlItems.DataSource = CreateDataSource();
this.ddlItems.DataBind();
this.ddlItems.DataTextField = "Name";
this.ddlItems.DataValueField = "ID";

Hope that helps you

Regards

Tags:

Jan 22 2006

Nested Datagrids in ASP.NET 1.1

Category:Bil@l @ 09:31

I got a question from a friend of mine  in Canada, on how to Edit the Nested Datagrid in ASP.NET 1.1, I referred her to the following good links:

Hope that helps you.

Regards

Tags:

Jan 21 2006

ASP.NET 2.0/1.1 Popup Calendar

Category:Bil@l @ 23:30

I would like you to visit this site and check the FREE ASP.NET 2.0/1.1 Popup Calendar.

I just used it in an ASP.NET page I am developing, its configuration is so simple, and easy to use.

Go and check it.

Regards

Tags:

Jan 21 2006

AssociatedControlID in ASP.NET 2.0

Category:Bil@l @ 21:02

I am customizing the CreateUserWizard to add some fields when adding a new user, and noticed that property called: AssociatedControlID.

For example:

<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="txtUserName">UserName</Label>
<asp:TextBox ID="txtUserName" runat="server" />


You can see that you have associated the Label FOR the TextBox. When the page runs, go to view source and you will find this:

<label for="txtUserName" id="UserNameLabel">UserName</label>
<input name="txtUserName" type="text" id="txtUserName" />

You will notice the FOR property added. This tells the Label that it is associated with the TextBox called *txtUserName.*
When you click your mouse on the label, the cursor will be active inside the TextBox, that is really cool :D

Regards


 

Tags:

Jan 21 2006

Internal and Public Access Modifiers in C#

Category:Bil@l @ 16:47

I am working on a project, in which I have several Class Libraries. In one of the class libraries, I wanted to use an object that can be accessed only inside the class library. What I did is I created the class as:

internal class X
{
    // Class content
}


Among my class in this class library, I had two objects, one of the objects calls a method inside the other object, and passes to it a parameter of type X, which is an internal object. One thing to mention here that all methods inside those objects have public direcive.
I used to get this error message:

Error 9 Inconsistent accessibility: parameter type 'NameSpace.X' is less accessible than method 'NameSpace.Object1.Create(NameSpace.X)'

I relaized later after some debugging that, when you want to pass an object marked as internal between methods in seperate objects, those objects should also be marked internal and not something else.

You might say, how will be able to access those methods from outside the class library. Well, in my case, I needed to use those internal objects for internal processing inside those methods. So, if a class has a method that uses one of the internal objects to process X job and then returns a value that has a basic data type or a custom object (not marked internal), then all work fine. Example:

public class Y
{
    public static bool IsRegistered(string username)
    {
        X _x = new X(username);
        bool result = IsValid(_x);

        return result;
    }    
}

As you can see, Y is a public class, and a method inside it is using the internal object and thus, that would be ok.

Hope that helps you.

Regards

Tags:

Jan 20 2006

Online RSS Reader

Category: General | GeneralBil@l @ 11:36

Hello:

I came across http://www.Squeet.com, which is a nice online utility to subscribe to blogs online. The nice thing about that tool, is that, all the new posts added by bloggers that you have subscribed to, will be sent to your inbox.

Also, I have been using the JetBrains Omea Rss Reader, I just exported my feeds, and imported them to Squeet and it worked smoothly.

Hope you like that tool!!

Regards

 

Tags: ,