ali raza

C#, .Net ,Asp.net and my thoughts

Identifying and non-identifying relationships

While searching the identifying and non identification releationship database concept.

An identifying relationship means that the child table cannot be uniquely identified without the parent. For example, you have this situation in the intersection table used to resolve a many-to-many relationship where the intersecting table’s Primary Key is a composite of the left and right (parents) table’s Primary Keys.

Example…
Account (AccountID, AccountNum, AccountTypeID)
PersonAccount (AccountID, PersonID, Balance)
Person(PersonID, Name)

The Account to PersonAccount relationship and the Person to PersonAccount relationship are identifying because the child row (PersonAccount) cannot exist without having been defined in the parent (Account or Person). In other words: there is no personaccount when there is no Person or when there is no Account.

A non-identifying relationship is one where the child can be identified independently of the parent ( Account – AccountType)

Example…
Account( AccountID, AccountNum, AccountTypeID )
AccountType( AccountTypeID, Code, Name, Description )

The relationship between Account and AccountType is non-identifying because each AccountType can be identified without having to exist in the parent table.

You can define the relationship type (identifying/non identifying) in the DeZign for Databases in the relationship dialog. Double click on the relationship line in the diagram window to display the relationship dialog.

reference : http://www.datanamic.com/support/relationshiptypes.html

Yetiş ya Muhammed yetiş ya Ali English translation

i found a beautiful Turkish song i search and placed its English translation

Bugün bize pir geldi gülleri teze geldi = Today, Pir (teacher, religious leader, Ustad, etc) visited us, and he came with fresh roses
Önü sıra kamberi ali yel murteza geldi = In front of him came Kamberi Ali El Murteza (Murteza = knowledgeable person)

Eyvallah şahım eyvallah Hak Lailahe İllallah = Eyvallah my shah (king) eyvallah, Hak La ilahe illallah
Eyvallah pirim eyvallah adı güzeldir güzelşah = Eyallah my pir eyvallah, his name is beautiful, He is beautiful, Shah.

Sen alisin güzelşah şahım eyvallah eyvallah = You are Ali, o my beautiful shah , eyvallah eyvallah
Ali bizim şahımız kabe kıble gahımız = Ali is our Shah and Ka’be is our kıblegah
Miraçtaki Muhammet o bizim padişahımız = Muhammed, who is on Mirach, is our king

Eyvallah şahım eyvallah Hak Lailahe İllallah = Eyvallah my shah (king) eyvallah, Hak La ilahe illallah
Eyvallah pirim eyvallah adı güzeldir güzelşah = Eyallah my pir eyvallah, his name is beautiful, He is beautiful, Shah.

Padişahım yaradan okur aktan karadan = My king (Allah) reads from black and white (knows everything)
Ben pirimden ayrılmam bin yıl geçse aradan = I would never leave my Pir, even if 1000 years passes

2- İnsanı insandan ayırıyorlar = they discriminate human from human
Bu sizden bu bizden kayırıyorlar = They support this(person) and they say that person is not form our society
Dört kitap ne diyor anlamıyorlar = They don’t understand what 4 holy books say (The Qur’an, Bible, Torah and Psalter)
Ortalık karıştı düzen bozuldu = The order has been spoiled and the world has gone out of order
Yetiş ya Muhammed yetiş ya Ali =Oh Muhammed, Come and help. Oh Ali come and help.

Yolumuz düştü Haci Bektaş’a = Our way took us to Haci Bektash
Kaderde olan gelirmiş başa = You experience whatever you have in your fate
Can düşman olmuş kardaş kardaşa = One brother is the enemy of the other brother
Yetiş ya Muhammed yetiş ya Ali =Oh Muhammed, Come and help. Oh Ali, come and help.

Anaya babaya saygı kalmamış = There is no respect for mother and father
İnsanlık elinden nasip almamış = some people have no ethic qualities
Herşeyi var ama gözü doymamış = He has everything, but he is still greedy

Bi çare insanlar nefsine uymuş = Poor, helpless people obey what their ego wants
Yetiş ya Muhammed yetiş ya Ali =Oh Muhammed, Come and help. Oh Ali come and help.

Öyle bir dünya ki kıran kırana = It is such a cruel world that everyone is destroying
Düşenin sırtından vuran vurana = There are so many people who torture the weak
Aşkolsun gerçekten bir dost bulana = How fortunate is the one who can find a real friend
insanlik yaralı can pazarında = Humanity is injured, is struggling to survive
Yetiş ya Muhammed yetiş ya Ali =Oh Muhammed, Come and help. Oh Ali come and help.

Oracle Form 6i developer tutorial

"!!!Zindagi Say Dartay Ho!!!"

“!!!Zindagi Say Dartay Ho!!!”

Zindagi say dartay ho
Zindagi to tum bhi ho
Zindagi to hum bhi hain

~~~~~~~~~~~~~~

Admi say dartay ho
Admi to tum bhi ho
Admi to hum bhi hain
Admi zuban bhi hai
Admi bayan bhi hai
Uss say tum nahein dartay!
Un-kahi say dartay ho
Jo abhi nahein aaee
Uss ghari say dartay ho
Uss ghari ki amad ki
Aagahi say daraty hoo

~~~~~~~~~~~~~~

Roshni say dartay ho
Roshni to tum bhi ho
Roshni to hum bhi hain
Roshni say dartay ho!

~~~~~~~~~~~~~~

Shahar ki faseelon per
Dave ka saya tha
Chak ho gaya akhir
Raat ka libada bhi
Chak ho gaya akhir
Khak ho gaya akhir
As-daham-e-insaan say fard ki loo aaee
Zaat ki sada aaee
Rah-e-shoq main jaisay rah-roh ka khoon lapkay
Aik naya junoon lapkay!

~~~~~~~~~~~~~~

Admi chalak uthay
Admi hansay daikhoo
Shahar phir basay daikho
Tum abhi say daraty ho!!!!!!!!!

~~~~~~~~~~~~~~

“!!!Zindagi Say Dartay Ho!!!”

“!!!Zindagi Say Dartay Ho!!!”

Zindagi say dartay ho
Zindagi to tum bhi ho
Zindagi to hum bhi hain

~~~~~~~~~~~~~~

Admi say dartay ho
Admi to tum bhi ho
Admi to hum bhi hain
Admi zuban bhi hai
Admi bayan bhi hai
Uss say tum nahein dartay!
Un-kahi say dartay ho
Jo abhi nahein aaee
Uss ghari say dartay ho
Uss ghari ki amad ki
Aagahi say daraty hoo

~~~~~~~~~~~~~~

Roshni say dartay ho
Roshni to tum bhi ho
Roshni to hum bhi hain
Roshni say dartay ho!

~~~~~~~~~~~~~~

Shahar ki faseelon per
Dave ka saya tha
Chak ho gaya akhir
Raat ka libada bhi
Chak ho gaya akhir
Khak ho gaya akhir
As-daham-e-insaan say fard ki loo aaee
Zaat ki sada aaee
Rah-e-shoq main jaisay rah-roh ka khoon lapkay
Aik naya junoon lapkay!

~~~~~~~~~~~~~~

Admi chalak uthay
Admi hansay daikhoo
Shahar phir basay daikho
Tum abhi say daraty ho!!!!!!!!!

~~~~~~~~~~~~~~

How to get month date view between two dates in c#

Scenario I got while developing some application. I required month and year view in drop down list between contract starting and ending date. Like “March 2009” “April 2009” until march 2011 so on.

I handled it as follow

DateTime _LoopDate = “1/1/2009”;
string month = string.Empty;
DateTime _EndDate = “1/1/2011”;

while (_LoopDate <= _EndDate)
{
System.Globalization.DateTimeFormatInfo d = new System.Globalization.DateTimeFormatInfo();
month = d.MonthNames[_LoopDate.Month – 1];

drpDate.Items.Add(new ListItem(month + ” ” + _LoopDate.Year.ToString(), _LoopDate.Month.ToString() + ” ” + _LoopDate.Year.ToString()));
//drpdate is dropdownlist
_LoopDate= _LoopDate.AddMonths(1);
}

How to get Month name from current date using c#

Hi i found two methods to do so.

Using Globliziation

System.Globalization.DateTimeFormatInfo d = new System.Globalization.DateTimeFormatInfo();
string month = d.MonthNames[DateTime.Now.Month-1];

Using new date object as follow

string MonthName = GetMonthName(DateTime.Now.Month);
static string GetMonthName(int monthNum)
{
return GetMonthName(monthNum, false);
}
static string GetMonthName(int monthNum, bool abbreviate)
{
if (monthNum < 1 || monthNum > 12)
throw new ArgumentOutOfRangeException(“monthNum”);
DateTime date = new DateTime(1, monthNum, 1);
if (abbreviate)
return date.ToString(“MMM”);
else
return date.ToString(“MMMM”);
}

Chears

how to get year from date in pl sql

pl Sql has function “Extract” this functions works wonders. I used it at many places in my application , i write some samples here

Years

select EXTRACT(YEAR FROM DATE ‘2008-3-17’)YEAR from dual;

Months

select EXTRACT(Month FROM DATE ‘2009-3-17’)Months from dual;

Day

select EXTRACT(day FROM DATE ‘2009-3-17′)Days from dual;

and how i used it my query

select * from tblSales_V where salesId in (select SalesId from OUTLET_SALE_V where outlet_Id =’001198’)
and EXTRACT(YEAR FROM issue_Date) = 2005

chears

Nice Regular expression for text input

i found a use full regular expression vaildating input string, you can use it to filter sql injection attacks while taking input for username, title ect.

^[a-zA-Z]+(([\.\- ][a-zA-Z0-9 ])?[a-zA-Z0-9]*)*$

Aaj Bazaar meiN pabajaulaN chalo

the poem by faiz ahmed faiz constantly comes in my mind. Check it out

 

 

Chashm-e-nam,Jaan-e-Shorida kaafi nahiN
Tohmat-e-Ishq posheeda kaafi nahiN
Aaj Bazaar meiN pabajaulaN chalo
Dast afshaaN chalo, mast-o-raqsaaN chalo
Khaak barsar chalo,khuN badamaaN chalo
raah takta hai sab shehr-e-jaanaN chalo
Aaj bazaar meiN pabajaulaN chalo
haakim-e-sheher bhi majama�e aam bhi
subh-e-nashad bhi,roz-e-nakaam bhi
teer-e-ilzam bhi sange dushnam bhi
pa ba jaulaaN chalo, aaj bazaar meiN
inka damsaaz apne siwa kon hai
shehr-e-jaanaN mein ab basifa kon hai
dast-e-qaatil ke shaayaN raha kon hai
rakht-e-dil bandh lo, dilfigaaro chalo
phir humiN qatal ho aayeN yaaro chalo
Faiz Ahmed Faiz