Hello try this one,
Select t.Table_Schema,
t.Table_Name,
c.Column_Name,
IsNull(c.Column_Default, '') as 'Column_Default',
c.Is_Nullable,
c.Data_Type,
IsNull(c.Character_Maximum_Length, IsNull(Numeric_Precision,'') + IsNull(Numeric_Scale, IsNull(DateTime_Precision,''))) as 'Size'
From Information_Schema.Tables t
Join Information_Schema.Columns c on t.Table_Catalog = c.Table_Catalog
And t.Table_Schema = c.Table_Schema
And t.Table_Name = c.Table_Name
Where t.Table_Type = 'BASE TABLE' and t.Table_Name='your table name'
Order by t.Table_Schema, t.Table_Name, c.Ordinal_Position
c# Code:
void FillData()
{
using (SqlCeConnection c = new SqlCeConnection(
your connection string))
{
c.Open();
using (SqlCeDataAdapter a = new SqlCeDataAdapter(
"your Query", c))
{
DataTable t = new DataTable();
a.Fill(t);
dataGridView1.DataSource = t;
}
}
}
Call this in your page load or button click an so on...
regards
sarva