Thursday, December 02, 2004

My new Blog

http://spaces.msn.com/members/raagz

Tuesday, November 30, 2004

ADO.Net 2.0 and enhancements

ADO.Net 2.0 and enhancements

The article compares ADO.Net 2.0 with 1.1 and lists down the enhancements for DataSet, DataTable and DataView classes.

Here are some of the new features in ADO.NET 2.0

  1. There has been a lot of performance
    improvement working with DataSet in 2.0.

  2. Now one can serialize a DataSet into
    binary data using
    ds.RemotingFormat
    = SerializationFormat.Binary

  3. DataTable now supports ReadXML,
    ReadXMLSchema, WriteXML and WriteXMLSchema methods.

  4. DataTable also includes 2 new methods
    GetDataReader and Load. GetDataReader returns a DataTableReader which can
    be used to iterate throw the rows just like SQLDataReader.

  5. Load method loads the table with
    specified IDataReader parameter. The second parameter is LoadOption enum (OverwriteRow,
    PreserveCurrentValues and UpdateCurrentValues). The article explains the
    differece between these in an easy to understand way.

  6. DataView has a new method ToTable()
    which returns DataTable object created out of the DataView.



When to call GC.Collect()

When to call GC.Collect()

Thursday, November 25, 2004

Why Are So Many Of The Framework Classes Sealed?

Why Are So Many Of The Framework Classes Sealed?: "Why Are So Many Of The Framework Classes Sealed?"

more here..
http://weblogs.asp.net/ericlippert/archive/2004/01/22/61803.aspx

Tuesday, November 23, 2004

Printer name in C#

Getting the Name of the Printer attached using C# Code

Use printer admin object (prnadmin.dll)

Here is the snippet...
Dim tObjPrinter As Object

Private mObjPrintMaster As Object

Try

mObjPrintMaster = CreateObject('PrintMaster.PrintMaster.1')

tObjPrinter = CreateObject('Printer.Printer.1')

mObjPrintMaster.PrinterGet('',PrinterName , tObjPrinter)

mObjPrintMaster.DefaultPrinter = mStrPrinterName

mObjPrintMaster.PrinterSet(tObjPrinter)

Catch ex As Exception

End Try"
Changing the server name after installing SQL server.

There are many a times when we might have to change our system name after installing SQL server and SQL might throw an error during some operations,
You need to change the srvname fields in the sysservers table in the master DB, but this cannot be done directly form the table view, as ad-hoc updates to this table is not allowed, below is an sp using which we can achieve the task.

****For Default Instance****
sp_dropserver
go
sp_addserver , local
go

****Foa a named instance****
sp_dropserver
go
sp_addserver , local
go

For more info and FAQs check this link.
http://support.microsoft.com/kb/257716/en-us"

Kannan's DOTNET Lounge

DOTNET reinstall script - a handy tool

*****This Script Corrects broken dll links, handy script if ur DOTNet installation does something funny......*****
*****write copy the entire script and save as a batch file.
***if u r typing from the command prompt, ignore the lines that start with 'Echo', type only the commands below the Echo line.

Echo Stop IIS
iisreset /stop

echo '----------------------'

echo 'Deleting the ASPNET account.'
net user ASPNET /delete

echo '----------------------'

echo 'Reregistering ASP.NET and the ASPNET account.'
aspnet_regiis -i

echo 'Restarting IIS.'
iisreset /start

echo '----------------------'"

Sunday, November 21, 2004

MSDN Beta documentation url

MSDN Beta documentation url,
http://msdn2.microsoft.com/library/default.aspx
Though this documentation is not complete, you can use this for reference.

Thursday, October 07, 2004

MSDN India Home Page

Microsoft: Longhorn Coming in 2006
http://www.entmag.com/news/article.asp?EditorialsID=6351

Wednesday, September 08, 2004

.NET Framework 2.0 SDK Beta 1 Samples

.NET Framework 2.0 SDK Beta 1 Samples

http://msdn.microsoft.com/netframework/downloads/samples/


Free RichTextBoxEditor in ASP.NET

Free ASP.NET HTML Editor for IE and Mozilla.

You can download the source code here..
http://www.freetextbox.com/

Tuesday, September 07, 2004

ASP.NET can now post to a different page

ASP.NET 2.0

ASP.NET can now postback across pages .You can use the PostTargetUrl attribute to specify
which ASPX the postback should go to.Once the postback happens to the target page, assuming
the page is different one than the one which made the postback The target page can access the
controls of the sender by using the PreviousPage object reference and extract the values from there.

Also, With Whidbey, you have a NGEN-kind-of application that will pre-compile your ASP.NET WebApps prior to deployment. This will speed up the initial invocation. The system has built-in health monitoring support that shall notify the parent incase of any issues in the
execution of any WebApp.

ASP.NET : you got to write resuable code (say a library), compile to an assembly
and then deploy it to the bin folder, and make changes to your pages
to reference it

Whidbey: With Whidbey, all this is gone. Simply write the code and put this code in a special folder called "Code"ASP.NET Whidbey shall compile this source at runtime, produce the assembly and make this assembly available for all the pages in the Web App




The ASP.NET V2.0 Page lifecycle

Learn and print ASP.NET V2.0 page lifecycle

http://hydrate.typepad.com/leo/images/asp.NET%20Page%20LifeCycle.html

Sunday, September 05, 2004

Runtime code generation and execution in C# using Reflection

This article demonstrates, how to execute the generated C# code in runtime.

http://www.microsoft.com/india/msdn/articles/242.aspx


ASP.NET 2.0 links

http://msdn.microsoft.com/asp.net/whidbey/default.aspx
http://www.asp.net/whidbey/Default.aspx?tabindex=0&tabid=1

Interview with Scott Guthrie

http://msdn.microsoft.com/asp.net/whidbey/scottgu.aspx

Books
Introducing Microsoft® ASP.NET 2.0 - Dino Esposito (Wintellect)http://www.microsoft.com/MSPress/books/6962.asp

A First Look at ASP.NET v 2.0 - http://www.daveandal.net/books/8960/


Articles on ASP.NET 2.0 http://www.codeguru.com/Csharp/.NET/net_asp/miscellaneous/article.php/c5365/

http://www.15seconds.com/issue/040804.htm

Validation Controls ASP.NET 2.0

Validation Controls

Introduced Validation groups.Developers faced one important limitation when using the validation controls. Since an ASP.NET page can include only one server-side form, there was no way to present multiple forms that included validation on the same page. Submitting any form in a page would trigger validation of all of the forms in the page.

This problem is solved in the ASP.NET 2.0 framework with the introduction of validation groups. In the ASP.NET 2.0 framework, the form controls, the button controls, and the validation controls have been modified to support a new property named ValidationGroup. Form controls in separate validation groups are validated independently.

more details..
http://msdn.microsoft.com/asp.net/whidbey/default.aspx?pull=/library/en-us/dnvs05/html/valgroups.asp

ViewState in ASP.NET 2.0

Viewstate in ASP.NET 2.0

The release of ASP.NET 2.0 brings several improvements to the view state mechanism that will make it easier to use without hindering your site's performance.

These improvements include a

  • ASP.NET 2.0 changes serialization format
  • reduction in encoding size
  • the introduction of control state to separate behavioral state from content
  • intelligent integration with data-bound controls
  • Introduction of Control state

For example, if we place a DataGrid on a form and bind it to the authors table in the pubs database, the size of the view state string in 1.x is 12,648 characters. If we do the same in 2.0, the size of view state is reduced to 6,728 characters, a reduction of nearly half.


Control state:Control state is another type of hidden state reserved exclusively for controls to maintain their core behavioral functionality, whereas view state only contains state to maintain the control's contents (UI). Technically, control state is stored in the same hidden field as view state (being just another leaf node at the end of the view state hierarchy), but if you disable view state on a particular control, or on an entire page, the control state is still propagated.

more details..

http://www.msdn.microsoft.com/asp.net/whidbey/default.aspx?pull=/msdnmag/issues/04/10/viewstate/default.aspx

Thursday, September 02, 2004

Saturday, August 28, 2004

.NET CLR Profiling

The Microsoft .NET platform provides you with a rich set of services for building profilers and application monitors for applications targeting the Common Language Runtime (CLR). These services expose runtime events that occur during the execution of a .NET application. They can be used to obtain information about managed code being executed under the runtime.
This article describes the .NET CLR Profiling Services and shows how to use the services to build a simple profiler that will provide hot spot information for any .NET application. The sample profiler can easily be modified to suit other profiling and monitoring needs.


http://msdn.microsoft.com/msdnmag/issues/01/11/NetProf/default.aspx