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.