Tuesday, July 18, 2006

Enable digrames in sql 2005 after importing from older sql versions

--enable SQL 2005 digrame

EXEC sp_dbcmptlevel 'YourDBName', '90';
go
ALTER AUTHORIZATION ON DATABASE::YourDBName TO "YourLoginName"
go
use [YourDBName]
go
EXECUTE AS USER = N'dbo' REVERT
go

Tuesday, June 27, 2006

Adding a serial number to a GridView

to add a column to your grid view in asp.net 2 you can add the following:

<%# Container.DataitemIndex+1 %>

Saturday, May 20, 2006

Arabic content filps too

Hi
In the last Geeks conference in dubai there was a lot about Arabic interface and other Arabic stuff so I will start to add more articles about this issue here.
I will try to start from were they ended in the conference.
We have an interface that support Arabic and English, the web document goes from left to right to right to left when needed.

So what's new, the data itself. Lets assume we had a drop down list that contain some lookup data (ex: Countries list) when we want to change to Arabic the Browser labels and direction change but not the data. So this is the simplest way I found to change the data itself.

In any field that contain strings that is needed in both languages we will add to the column name in the database table (Arabic) and (English) so if we had a table for countries called Countries and contained an ID and a Name field we will rename the Name field to NameEnglish and Add another field with the name NameArabic

Original Table
Countries

Fields
ID
Name

New Table (Multi Language)
Countries
Fields
ID
NameArabic (better to make the field Unicode for example nvarchar(100))
NameEnglish

In the binding filed of the drop down list we will do the following.

If we have the language in the profile
Eval("Name"+Profile.Language.tostring)
The Profile.Language field must contin the word Arabic or English

Or if we have the language in the QueryString:
Eval("Name"+Request.QueryString("Language"))
Note: the query string must contain the string Arabic or the word English

So now not only the interface flips but even the content. This technique can be used in gridview, datalist or any binding context

Sunday, April 23, 2006

Arabic Net Blog

here we want to talk about the Arabic futures and problems with the net framework.