1. null value addition.
If null is added to other values (if varchar characters are used, the result is a null value. This is not expected in some composite character operations, so use the isnull function, if the value is null, a default value is assigned.
Example: declare @ location varchar (300)
Set @ location =''
Select
@ Location = isnull (Ri. Location ,''),
From job_resumeinfo ri
Where Ri. resumeid = @ resumeid
If the isnull function is not used and RI. Location is null, null is always returned. If the isnull function is added, ''is returned''
2. If the table field is left blank, dbnull must be used. Private Static bool isdbnull (idatareader DR, string name)
{
Int Index = dr. getordinal (name );
Return dr. isdbnull (INDEX );
}
Private Static string getstring (idatareader DR, string name)
{
If (! Isdbnull (DR, name ))
Return (string) Dr [name];
Return NULL;
}
Private Static int getint32 (idatareader DR, string name)
{
If (! Isdbnull (DR, name ))
Return (INT) Dr [name];
Return 0;
}
Private Static datetime getdatetime (idatareader DR, string name)
{
If (! Isdbnull (DR, name ))
Return (datetime) Dr [name];
Return datetime. now;
}
Private Static bool getboolean (idatareader DR, string name)
{
If (! Isdbnull (DR, name ))
Return (bool) Dr [name];
Return false;
}
Private Static guid getguid (idatareader DR, string name)
{
If (! Isdbnull (DR, name ))
Return (guid) Dr [name];
Return guid. empty;
}
3. If SQL2000 is originally installed with a default instance and sql2005 is to be installed, you must configure a custom instance for sql2005, or log on to the SA. If you use a custom instance, you must add the name of the custom instance after the server name when writing the connection string to the Enterprise Manager, for example, CJB \ sql2005.