What are the Differences between dataset.clone and dataset.copy?

Saturday, July 11, 2009


Clone - Copies the structure of the DataSet.

Copy - Copies both the structure and data of the DataSet.


www.codecollege.NET

What are the different methods and Properties of DataReader which you have used in your project?


Read

GetString

GetInt32


www.codecollege.NET

What is compile time binding and run time binding? (or) What is early/late binding? Explain with an example.

Thursday, July 9, 2009


An object is early bound when it is assigned to a variable declared to be of a specific
object type. Early bound objects allow the compiler to allocate memory and perform other

optimizations before an application executes.



' Create a variable to hold a new object.

Dim FS As FileStream

' Assign a new object to the variable.

FS = New FileStream("C:\tmp.txt", FileMode.Open)



By contrast, an object is late bound when it is assigned to a variable declared to
be of type Object. Objects of this type can hold references to any object, but lack
many of the advantages of early-bound objects.


Dim xlApp As Object

xlApp = CreateObject("Excel.Application")


www.codecollege.NET

Which method will be called from the following code? (or) Explain Polymorphism with override Modifier in c#.


using System;
using System.Collections.Generic;
using System.Text;

namespace OOPs21
{
class BaseClass
{
public virtual string ShowMe()
{

return "base";
}
}
class DerivedClass : BaseClass
{
public override string ShowMe()
{

return "derive";
}

public static void CallShowME(BaseClass objBC)
{
Console.Write(objBC.ShowMe());
}


public static void Main()
{
DerivedClass vardc = new DerivedClass();
CallShowME(vardc);
Console.Read();
}

}
}




Answer:

derive


Which method will be called from the following code? (or) Explain Polymorphism with New Modifier


using System;
using System.Collections.Generic;
using System.Text;

namespace OOPs21
{
class BaseClass
{
public string ShowMe()
{

return "base";
}
}
class DerivedClass : BaseClass
{
public new string ShowMe()
{

return "derive";
}

public static void CallShowME(BaseClass objBC)
{
Console.Write(objBC.ShowMe());
}


public static void Main()
{
DerivedClass vardc = new DerivedClass();
CallShowME(vardc);
Console.Read();
}

}
}




Answer:

base


How to use the new modifier in hiding base class method?


using System;
using System.Collections.Generic;
using System.Text;

namespace OOPs21
{
class BaseClass
{
public string ShowMe()
{

return "base";
}
}
class DerivedClass : BaseClass
{
public new string ShowMe()
{

return "derive";
}


public static void Main()
{
DerivedClass vardc = new DerivedClass();
Console.Write(vardc.ShowMe());
Console.ReadLine();
}

}
}







What is Pinvoke?






Platform invoke is a service that enables managed code to call unmanaged functions implemented in dynamic-link libraries (DLLs), such as those in the Win32 API. It locates and invokes an exported function and marshals its arguments (integers, strings, arrays, structures, and so on) across the interoperation boundary as needed.





Blog Widget by LinkWithin