Monday, July 18, 2005

String.Contains + Some Other String Improvements in VS2005

There's some things just so glaringly obvious, so innately presupposed that you just assume it's there and it's an impossible task to convince your brain otherwise.

For me, this is string.Contains. For years I've typed "name.Conta…" only to stop and realize that it's not there. I begrudgingly type in "name.IndexOf("sdfsd")>-1" instead. The next time I do the same. In fact I've been using .Net since it was in early beta and yet I still haven't come to terms with the fact string.Contains is missing.

Then today, working in VS 2005, I once again accidentally type it in - and to my disbelief it's actually there! Very cool.

Couple of other things I noticed:

1. String.Split now accepts strings. That means you can split a string like “bob and harry and mary and jane“ on “and“ and you'll get just the people names.

2. String.NullOrEmpty is a new static method that returns true if the string is null or empty (““). All those times I've used code like “if (name==null || name==““) “...

That's what I call progress.

C# source code line counter and a .net complexity analyzer (using the cyclomatic complexity index !!

http://dotnetjunkies.com/WebLog/johnwood/archive/2005/01/16/44995.aspx

Friday, July 08, 2005

Difference b/w ADO and ADO.NET

Differences Between ADO and ADO.NET

ADO and ADO.NET have various differences, such as differences in architecture, data representation, and methods of sharing data between applications.

In-Memory Representations of Data
ADO uses a recordset to represent data that is retrieved from tables in memory, whereas ADO.NET uses DataSets. A recordset usually contains data from a single table. To store data from multiple tables, you use a JOIN query. The JOIN query retrieves the data from multiple tables as a single result table. Alternatively, ADO.NET uses a DataSet to represent data in memory. As mentioned earlier, a DataSet can store data from multiple tables and multiple sources. In addition, a DataSet can also contain relationships between tables and the constraints on a table. Therefore, a DataSet can represent the structure of a database.

ADO provides a read-only navigation on recordsets, which allows you to navigate sequentially through the rows of the recordset. However, in ADO.NET, rows are represented as collections. Therefore, you can access records using the primary key index. In addition, you can also filter and sort results.

Minimized Open Connections

In ADO.NET, you only connect to a database to retrieve and update records. You can retrieve records from a database, copy them into a DataSet, and then disconnect from the database. Although a recordset can provide disconnected data access in ADO, ADO was primarily designed for connected scenarios.

In ADO.NET, you communicate with the database using a DataAdapter or a DataReader that makes calls to an OLE DB provider or to the APIs provided by the data source.

Sharing Data Between Applications
You use COM marshaling in ADO to transfer a disconnected recordset from one component to another. In ADO.NET, you transfer a DataSet using an XML stream. XML provides the following advantages over COM marshaling when transferring data:

Richer data types.
COM marshaling can only convert data types that are defined by the COM standard. In an XML-based data transfer, restrictions on data types do not exist. You can use XML-based data transfer to transfer any data that is serializable.

Bypassing firewalls.
A firewall does not allow system-level requests, such as COM marshaling. Therefore, a recordset cannot bypass a firewall. However, because firewalls allow HTML text to pass and ADO.NET uses XML to transfer DataSets, you can send an ADO.NET DataSet through a firewall.

ADO.NET Architecture Diagram !!

Sunday, July 03, 2005

MCAD Curriculum !! .NET Certification

http://www.msnusers.com/dotnetusergroupHyd/Documents/MCAD/GetCertified%2Edoc?t=6Kbmod!HwFS0cCqORc8q11L5ffL*Rgh8f!XhiuOL5BB5!ik*Ro6u4WvoplAjaTP0*duXGQlZyo2UiuTK9lnkigQOrB5EiK2d5S1DG2WEV5Gk*It2xRjMZu*Q$$&p=6sZOl*PNwCl8lUVzZe6fwS6hNIjkz1cq*HOUvKatry5phELqQ4YIGWZxBg6f3*ABmUkT!aWxS0TFcJ8SzbVsL32hpqNf7ARLqJo6NWGlKimTQ95lffwpFlboXNti05MqiL1Q473Tee1ltXhX058BWv7ovuczKUEpaUn07F1kntUUCd30RpQf!0GQ$$