Random Snippet of Code and Life

Archive for the 'ASP.net' Category


13
Apr

Converting entries in ArrayList to DataTable

Let say you want to convert all your entires in an ArrayList and place them inside a DataTable for the purpose of populating a DataList, how to do it? For eg. We create an ArrayList and load it with a bunch of integers
ArrayList list = new ArrayList();for(int x=0; x < 10; x++)
{
list.add(x);
}
So we have an […]

Popularity: 11% [?]


24
Mar

SQL Date Formatting (for oracle, ms sql, mysql)

How many times have you scream in frustration when you try to manipulate that stupid datetime in your database?
Here is some good site with guides on doing it easily)

Oracle
http://infolab.stanford.edu/~ullman/fcdb/oracle/or-time.html

MS SQL
http://www.databasejournal.com/features/mssql/article.php/2197931

MY SQL
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html

Popularity: 6% [?]

Popularity: 6% [?]


21
Mar

Passing parameter from one page to the other page

There are several ways we can pass parameter from one to another page.
1) Using the URL/QueryString input to Response.Redirect method
To pass the parameter, we simply append each parameter in a name=value pair fashion to the end of the url after a “?”.
For eg. Response.Redirecti(”~/Abc.aspx?name1=value1;name2=value2″);
separate each parameter with a “;”
*This is similiar to using GET method […]

Popularity: 13% [?]


20
Mar

Populating each DropDownList (differently) in a DataList/DataGrid Control

I was doing my ecommerce project today when I discover that I would need to populate each of the DropDownList differently in one of my Products DataList in my project.
As the DropDownList is in the ItemTemplate of the DataList, I am kind of stuck there trying to reference the correct DropDownList in each Row of […]

Popularity: 5% [?]

Random Snippet of Code and Life is is proudly powered by Wordpress
Navigation Theme by GPS Gazette