How to Create a class from database

Generate Class from database
http://stackoverflow.com/questions/47239/how-can-i-generate-database-tables-from-c-sharp-classes 
How to get a table name from database 
DataTable t = _conn.GetSchema("Tables");
_conn is a connection string (http://stackoverflow.com/questions/3005095/can-i-get-name-of-all-tables-of-sql-server-database-in-c-sharp-application) 
Read the Column Names from table
public static string GetColumnNames( System.Data.DataTable table)
{
if (table != null)
{
List lstColumn = new List();

foreach (System.Data.DataColumn col in table.Columns)
{
lstColumn.Add(col.ColumnName);
}

return String.Join(",", lstColNames.ToArray());
}

return string.Empty;
}

test

private static int MakeExecNonQuery(string Query)
        {
            int id = 0;

            SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["DBConnection"].ConnectionString);
            SqlCommand cmd = new SqlCommand(Query, con);

            con.Open();
            var rowCount = cmd.ExecuteScalar();
            con.Close();
            if (rowCount != DBNull.Value)
                id = Convert.ToInt32(rowCount);


            return id;
        }

        public static void MakeDataSet(DataSet ds, String strSQL)
        {
            try
            {
                SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["DBConnection"].ConnectionString);
                con.Open();
                SqlCommand cmd = new SqlCommand(strSQL, con);
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                da.Fill(ds);
                con.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

private static List<ColorTable_Master> GetColorTable_Masters()
        {
            List<ColorTable_Master> ColorTable_Masterlist = new List<ColorTable_Master>();
            String cmd = "SELECT * FROM mytable";
            DataSet dsColorTable_Master = new DataSet();
            DBAction.MakeDataSet(dsColorTable_Master, cmd);
            if (dsColorTable_Master.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dsrow in dsColorTable_Master.Tables[0].Rows)
                {
                    ColorTable_Master cObj = new ColorTable_Master();

                    if (dsrow["Id"] != DBNull.Value)
                    {
                        cObj._Id = int.Parse(dsrow["Id"].ToString());
                    }
                   
                    ColorTable_Masterlist.Add(cObj);
                }
            }
            return ColorTable_Masterlist;
        }