Hello Everyone,
Actually i have one question. I create one generic method like below:-
public static dynamic ExecuteSelectProcedure<T>(string procedureName) where T: class
{
SqlDataReader reader = ExecuteSelectCommand(procedureName, CommandType.StoredProcedure);
if (typeof(T).FullName.Equals("System.Data.DataTable"))
{
DataTable dt = new DataTable();
dt.Load(reader);
reader.Close();
return dt;
}
return reader;
}
Now i want to restrict user to give type name only SqlDataReader or DataTable for T
Is it possible?
Please give some idea.
Thank's