Chris Ongsuco's Weblog
Information Technology, business, life, food...

February 2005 Entries

My Nerd Quiz

Just Lucky: This is what I get when I just answer without reading the questions. :-)

SQL Running Total

Good for reporting...try it! Use Northwind SELECT P.ProductID, P.ProductName, P.UnitsInStock, (SELECT SUM(UnitsInStock) FROM Products WHERE ProductID FROM Products P

DataTableReader?! Yes Sir!

The nice thing about working fast and accurately is that you finish your work ahead of schedule. Like me if I finish my work early I'd make sure that I do something important/productive rather than waiting and do nothing. So here's something I discovered in .Net 2005 Beta 1. ConnectionStringSettingsCol... cssc = ConfigurationSettings.Conne... string connectionstring = cssc["Main"].ConnectionString; string sql = "select * from Customers"; SqlConnection conn = new SqlConnection(connectionstr...

Command.ExecuteRow()

ExecuteRow is a new method in .net that will return 1 record from the query. Here is a sample from .Net Beta 1: ConnectionStringSettingsCol... cssc = ConfigurationSettings.Conne... string connectionstring = cssc["Main"].ConnectionString; string sql = "select * from Customers where CustomerId = 'ANTON' "; // Using Northwind Database SqlConnection conn = new SqlConnection(connectionstr... SqlCommand cmd = new SqlCommand(sql, conn); conn.Open(); SqlRecord record = cmd.ExecuteRow(); Response.Write(record["Cont...

Playing with ExecutePageReader

I've been playing with VS.Net 2005 Beta 1 since December 2004 and here is a sample code snippet: private void BindControl(int pageIndex) { ConnectionStringSettingsCol... cssc = ConfigurationSettings.Conne... string connectionstring = cssc["Main"].ConnectionString; string sql = "select * from Customers"; // Using Northwind Database SqlConnection conn = new SqlConnection(connectionstr... SqlCommand cmd = new SqlCommand(sql, conn); conn.Open(); SqlDataReader dr = cmd.ExecutePageReader(Comma...