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
{
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;
}