This is a common question that we need in most of the time in developing. .NET provides powerful function in Enum Class to do that.
enum DBType
{
SQLSERVER,
ACCESS,
SQLCE
}
private static DBType getDBType()
{
String dbType = "SQLCE";
return (DBType)Enum.Parse(typeof(DBType),dbType);
}
Comments