Array vs. ArrayList in ASP.NET

ArrayList and List Collection Types

.NET Framework 2.0

Other Versions

4 out of 6 rated this helpful – Rate this topic

An ArrayList or List object is a sophisticated version of an array. The ArrayList class and the List generic class provides some features that are offered in most System.Collections classes but are not in the Array class. For example:

The capacity of an Array is fixed, whereas the capacity of an ArrayList or a List is automatically expanded as required. If the value of the Capacity property is changed, the memory reallocation and copying of elements are automatically done.


ArrayList and List provide methods that add, insert, or remove a range of elements. In Array, you can get or set the value of only one element at a time.


A synchronized version of ArrayList or List is easy to create using the Synchronized method. The Array class leaves it up to the user to implement synchronization.


ArrayList and List provide methods that return read-only and fixed-size wrappers to the collection. Array does not.

On the other hand, Array offers some flexibility that ArrayList and List do not. For example:

You can set the lower bound of an Array, but the lower bound of an ArrayList or a List is always zero.


An Array can have multiple dimensions, while an ArrayList or a List always has exactly one dimension.


An Array of a specific type (other than Object) has better performance than an ArrayList because the elements of ArrayList are of type Object and, therefore, boxing and unboxing typically occur when storing or retrieving a value type. However, a List can have similar performance to an array of the same type if no reallocations are required; that is, if the initial capacity is a good approximation of the maximum size of the list.

Most situations that call for an array can use an ArrayList or a List instead; they are easier to use and, in general, have performance similar to an array of the same type.

Array is in the System namespace; ArrayList is in the System.Collections namespace; List is in the System.Collections.Generic namespace.

See Also

Reference
ArrayList
System.Collections
List
System.Collections.Generic
Array

Other Resources
Commonly Used Collection Types

Source: http://msdn.microsoft.com/en-US/library/41107z8a(v=vs.80).aspx

SharePoint Hide Ribbon Actions

//Hide Save button on Ribbon, also being hidden by
SPRibbon ribbon = SPRibbon.GetCurrent(this.Page);
if (ribbon != null)
{
ribbon.TrimById(“Ribbon.ListForm.Edit.Commit.Publish”);
ribbon.TrimById(“Ribbon.ListForm.Edit.Actions.DeleteItem”);
ribbon.TrimById(“Ribbon.ListForm.Edit.Clipboard”);
ribbon.TrimById(“Ribbon.ListForm.Edit.SpellCheck”);
}

Microsoft HTML5 Exam (Exam 70-481)

Microsoft HTML5 Exam Voucher (Exam 70-481)

http://www.microsoft.com/learning/en/us/html5-offer.aspx

Exam Page:

http://www.microsoft.com/learning/en/us/Exam.aspx?ID=70-481

Learning Modules:

http://www.microsoftvirtualacademy.com/tracks/developing-html5-apps-jump-start

Modules 1

Modules 2

Modules 3

Modules 4

Modules 5

Modules 6

 

http://channel9.msdn.com/Series/MVA-Jump-Start/Developing-Windows-Store-Apps-with-HTML5-Jump-Start-01a-Designing-a-Windows-8-App-Part-1

 

SQL Merge Example

[codesyntax lang=”sql”]

DROP TABLE #employee;

DROP TABLE #employee1;

CREATE TABLE #employee (

employee_id integer,

first_name  VARCHAR(20),

last_name   VARCHAR(20),

dept_no     integer,

salary      integer);

INSERT INTO #employee VALUES (1, 'Dan', 'Morgan', 10, 100000);

INSERT INTO #employee VALUES (2, 'Jack', 'Cline', 20, 100000);

INSERT INTO #employee VALUES (3, 'Elizabeth', 'Scott', 20, 50000);

INSERT INTO #employee VALUES (4, 'Jackie', 'Stough', 20, 40000);

INSERT INTO #employee VALUES (5, 'Richard', 'Foote', 20, 30000);

INSERT INTO #employee VALUES (6, 'Joe', 'Johnson', 20, 70000);

INSERT INTO #employee VALUES (7, 'Clark', 'Urling', 20, 90000);

SELECT * FROM #employee;

CREATE TABLE #employee1 (

employee_id integer,

first_name  VARCHAR(20),

last_name   VARCHAR(20),

dept_no     integer,

salary      integer);

INSERT INTO #employee1 VALUES (1, 'Dan', 'Morgan', 10, 100001);

INSERT INTO #employee1 VALUES (2, 'Jack', 'Cline', 20, 100000);

INSERT INTO #employee1 VALUES (3, 'Elizabeth', 'Scott', 20, 50002);

INSERT INTO #employee1 VALUES (4, 'Jackie', 'Stough', 24, 40000);

INSERT INTO #employee1 VALUES (5, 'Richard', 'Foote', 20, 30003);

INSERT INTO #employee1 VALUES (6, 'Joe', 'Johnson', 20, 70004);

INSERT INTO #employee1 VALUES (97, 'Clark', 'Urling', 23, 90000);

SELECT * FROM #employee1;

MERGE INTO #employee E

USING (

  SELECT *

  FROM #employee1) E1

ON (E.employee_id = E1.employee_id)

WHEN MATCHED THEN

  UPDATE SET E.dept_no = E1.dept_no, E.salary = E1.salary

WHEN NOT MATCHED THEN

  INSERT VALUES (E1.employee_id,E1.first_name,E1.last_name,E1.dept_no,E1.salary);

  SELECT * FROM #employee;

  SELECT * FROM #employee1;

[/codesyntax]

SQL Server 2012 Express Edition – Error Enabling Full Text Search

I recently wanted to try out the new version of SQL Server 2012 Express Edition with Advanced Services. Microsoft blog states that this version offers Full Text Search, so I was surprised when I received the following error trying to set up a new catalog.

Full-text is not supported on this edition of SQL Server. (Microsoft.SqlServer.Smo)

It appears that Full-text index is available, but not through the GUI.  I had to script the catalog and the creation of the full text index.

To accomplish this again, a link to Microsofts Full Text MSDN page is helpful.

http://msdn.microsoft.com/en-us/library/ms187317.aspx