You are building a data access layer in an application that contains the following code:

HOTSPOT
You are building a data access layer in an application that contains the following code:

For each of the following statements, select Yes if the statement is true. Otherwise, select No.

HOTSPOT
You are building a data access layer in an application that contains the following code:

For each of the following statements, select Yes if the statement is true. Otherwise, select No.

Answer:



Leave a Reply 3

Your email address will not be published. Required fields are marked *


harsh

harsh

no, yes, no

J

J

Here the test:

public static void Main(string[] args)
{
// DateTime
Console.WriteLine(GetTypeDefault(DbType.DateTime));
// Int64
Console.WriteLine(GetTypeDefault(DbType.Int64));
// Double
Console.WriteLine(GetTypeDefault(DbType.Double));
}

public static Object GetTypeDefault(DbType dbDataType)
{
switch(dbDataType)
{
case DbType.Boolean:
return false;
case DbType.DateTime:
return DateTime.MinValue;
case DbType.Decimal:
return 0m;
case DbType.Int32:
return 0;
case DbType.String:
return String.Empty;
default:
// Code modified for a better understanding of the test.
return “null”;
}
}