Rangoli Kannan - Technical Blog

This blog mainly created for my juniors.

You have an 'Enum' defined as follows:

public enum CompanyAddressType
{
Unknown = 0,
Primary = 1,
Warehouse = 2,
Distribution_Center = 3,
Cross_Dock = 4
}


You want to iterate through the list and put the data into an asp.net DropDownList.

Here is the simple code:


protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string[] names = Enum.GetNames(typeof (CompanyAddressType));
var values = (CompanyAddressType[]) Enum.GetValues(typeof (CompanyAddressType));
for (int i = 0; i < names.Length; i++)
{
DropDownListCompanyAddressType.Items.Add(new ListItem(names[i], values.ToString()));
}
}
}

There are probably easier ways to do it, but this works.


Use the tips!


உங்களுடைய ஜிமெயில் அக்கவுண்ட்டை மவுஸ் கொண்டு செலுத்துவதற்குப் பதிலாக கீ போர்டு ஷார்ட் கட் கீகள் மூலம் செயல்படுத்தலாம். இந்த கீ போர்டு ஷர்ர்ட் கட் கீகளைப் பயன்படுத்துவதனால் நம் நேரம் மிச்சமாகிறது. மேலும் கீ போர்டிலிருந்து கைகளை எடுக்காமல் விரைவாக நம்மால் செயல்பட முடியும்.

இதோ சில ஷார்ட் கட் கீகள்:

F : கீயை மட்டும் அழுத்தினால் இமெயில் செய்தியை அடுத்ததற்கு பார்வேர்ட் செய்திட முடியும்.

/: சர்ச் பாக்ஸில் உங்கள் கர்சரை நகர்த்த

Shift+l : இமெயில் மெசேஜைப் படித்ததாக குறியீடு செய்வதற்கு

Shift+u : இமெயில் மெசேஜைப் படிக்காததாகக் குறியிட

r : மெயிலை அனுப்பியவருக்கு பதில் அனுப்ப.

u : உங்களுடைய இமெயில் அக்கவுண்ட்டை ரெப்ரெஷ் செய்து லேட்டஸ்டாக வந்த இமெயில் மெசேஜை காண

a : அனைத்து மெயில் பெற்றவர்களுக்கும் பதில் அனுப்ப

ctrl+c
: அப்போதைய இமெயிலை ட்ராப்டாக சேவ் செய்திட

Z : முந்தைய செயல்பாட்டை கேன்சல் செய்திட

? : கீ போர்டு ஷார்ட் கட் கீகள் குறித்த உதவிக் குறிப்புகளைக் காட்ட

c : புதிய இமெயில் மெசேஜ் ஒன்றை எழுதிட

! : இமெயில் மெசேஜ் ஒன்றை ஸ்பாம் மெயிலாகக் குறிப்பிட

p : தற்போதைய மெயிலுக்கு முன் உள்ள மெயிலுக்குச் செல்ல

. : வெறும் புள்ளி அடித்தால் கூடுதலான ஆப்ஷன்ஸ் காட்டப்படும்.

Esc : கர்சரை தற்போதைய பீல்டிலிருந்து நகர்த்தும்.

இந்த பதிவினை படிக்கும் நீங்கள் மறக்காமல் உங்கள் கருத்துகளை என்னிடம் தெரிவிக்கலாம். உங்கள் கருத்துகளுக்காக காத்திருக்கும் நண்பன் - ரங்கோலி.

First, we will create a table that has primary key. Next, we will drop the primary key successfully using the correct syntax of SQL Server.

CREATE TABLE Table1(
Col1 INT NOT NULL,
Col2 VARCHAR(100)
CONSTRAINT PK_Table1_Col1 PRIMARY KEY CLUSTERED (
Col1 ASC)
)
GO

Second, try to drop the primary key constraint using following lines.

/* For SQL Server/Oracle/MS ACCESS */
ALTER TABLE Table1
DROP CONSTRAINT PK_Table1_Col1
GO
/* For MySql */
ALTER TABLE Table1
DROP PRIMARY KEY
GO


Use the tips!!!