May 5 2006

Localization in ASP.NET 2.0

Category: ASP.NET 2.0 - General | General | GeneralBil@l @ 06:12

I would like to invite you to check my latest article on the ASPAlliance.com.

The article is titled Localization in ASP.NET 2.0

Hope you will enjoy this article.

Regards

Tags: , ,

Apr 16 2006

Happy Easter - Part 1

Category: General | GeneralBil@l @ 13:27

I would like to wish all the world's Christians, and mainly our brothers and sisters, the Lebanese Christians, having their Easter this week, a Happy Easter, with the hope and wish of having more peace and wealth all over our beloved country Lebanon.

 

Thank you.

Tags: ,

Mar 4 2006

Difference between NULL and DBNull

I have always misunderstood the difference between NULL and DBNULL until recently while I was working on ASP.NET web application, and was talking to a Webservice and I found an exception coming from one of the web methods inside the Webservice which is using the SqlCommand.ExecuteScalar() method.

What happens when the ExecuteScalar() method is used? Usually, the ExecuteScalar() method returns the First Column of the First Row returned by the database stored procedure or SQL query.

Suppose for example you are searching for the CustomerPhone of the customer named "Bilal Haidar", and that customer didn't have any record in the database, so a query such as:

public string Get_Customer_ID(string UserName)
{
   // Prepare database connection
   SqlConnection conn = new SqlConnection("...");
   // Prepare command to execute
   SqlCommand cmd = new SqlCommand("SELECT CustomerPhone FROM Custoers WHERE CustomerName = 'Bilal Haidar'", conn);

   // Execute the command and store result in an object
   object objResult = cmd.ExecuteScalar();






if (objResult == null) return "Customer not found in our database";
if (objResult == System.DBNull.Value) return "Customer found but his/her phone number is null"; return (string) objResult; }

So now here how it goes. The query will search for the Customer Phone. We are returning the result and storing it in the objResult object.

If the result object is null, then there is no record in the database with the username specified.

If the result value is not null, we need to check if the Cutomer Phone field has a value or not, how do you do so? Using the DBNull.Value would check for you if the field returned is null or not.

So, comparing the ExecuteScalar() to null means, we are checking if there is a record returned, and checking if value of the first column of the first row is null or not, means we need to check against DBNul..Value

Hope you have now a better understanding of the difference between NULL and DBNull

Regards

Tags: , , , ,

Mar 4 2006

I am back . . .

Category: General | GeneralBil@l @ 20:09

Hello:

You might be asking where I have been all this time. Well, I have been away a bit from posting, first for getting some sickness which I am over it by now and second, I was working on a community website for Microsoft in the area of Middle East.

The website is www.devconnect.net, it is a Microsoft Development Community site. I invite you all and welcome you all to the webisite, to register their, to have the chance to write your own articles, code samples, share with us your experience, knowledge, help on the forums, and get helped.

The website was my first experience in DotNetNuke. I learned a lot in the lsat few weeks in the field of DotNetNuke, developed my own custom modules and enjoyed working with it a lot.

In the coming few days, I will be posting many interesting code samples and ideas that I have gathered in the last few weeks.

Regards to all,

Tags: ,

Feb 27 2006

First Day of Fasting . . .

Category: General | GeneralBil@l @ 10:47

I would like to take this opportunity to wish all the Lebanese and especially our Marronite brothers in Lebanon and in the whole world a happy fasting.

May fasting be in all aspects in life, not only in food, but fasting from verything evil and bad.

Best Regards,

 

Tags: ,

Feb 25 2006

MSDN Magazine Online as .CHM File

Category: General | GeneralBil@l @ 16:11

Great new for developers:

MSDN magazine is now available for download as a .CHM file.

Visit the MSDN Magazine Area and check all the downloads.

Hope that helps,

Regards

Tags: ,

Jan 27 2006

Upgraded my website to CS 2.0 Beta 3

Category: General | GeneralBil@l @ 11:01

I have just finished upgrading my website to CS 2.0 Beta 3.

I have also played around a bit with CS files and created a Custom Link, to show how easy it is to work with a CS website.

Although it is not yet a CMS, however, it could be used now for a community site very easily, specially that adding new links and sections is not a tough thing to do.

Hope you enjoy the stay,

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: ,

Jan 18 2006

My Official Blog

Category: General | GeneralBil@l @ 08:27

Hi:

I would like to welcome you all to  my official blog, which is now hosted on my own hosting account.

I installed the CommunityServer 1.1 locally, then uploaded the files and the database to my hosting account at WebHost4Life.com.

I used the FoggyValley theme for  my Blog, which can be downloaded from here.

I also used the Single Blog/Gallery SiteUrls Generator for CS 1.1, which helped me create a single blog/gallery on this website.

I hope you like my new website. I wish I will be able to deliver good stuff for you all, to benefit as much people as possible all over the world.

Keep an eye on this blog for .NET tips, tricks and good resources.

I would like to thank WebHost4Life Technical Support and Wessam Zeidan, the Palestinian MVP (Lebanon Resident), for helping me out on configuring and installing my new blog.

Regards,

 

Tags: ,

Jan 16 2006

The Dream - Episode 2

Category: General | GeneralBil@l @ 01:47

I spent the whole day working on my dream. It is taking lots of time, but at least, there is something making me happy these days !!

Keep an eye here!!

Regards

Tags: ,