Hi folks,
I need ur help, view the following code snippet

public xxxx func1()
{
--
--
return xx;
}

This is a sample function in C#. which may return string/Datetime/Datatable.

Is there any way by which same function return different data types at different times.
please reply asap.

You can write a generic function to return whatever type is required of a function. Here is a simple example.

public T GetDefaultValue<T>(T input)
{
    return default(T);
}

And using it

DateTime myDate = GetDefaultValue<DateTime>();
int myInt = GetDefaultValue<int>();
double myDouble = GetDefaultValue<double>();
string myString = GetDefaultValue<string>();