hey pubby,
you can do something like this-
public DataTable GetDataTable(string query)
{
SqlConnection conn = new SqlConnection(ConfigurationSettings.AppSettings["conn"].ToString());
SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = new SqlCommand(query, conn);
DataTable FilteredDataTable = new DataTable();
conn.Open();
try
{
adapter.Fill(GetDataTable);
}
finally
{
conn.Close();
}
return GetDataTable;
}
RadGrid1.DataSource = GetDataTable("SELECT UID, Email_TemplateName as 'Name', Mail_Text as 'Mail text',Mail_Subject as 'Mail Subject' FROM Entry");
in web config--
<pre lang="xml"><appSettings>
<add key="conn" value="Data Source=Amit;Initial Catalog=Entry;User ID=sa;Password=as" />
</appSettings>
which control are you using to view the db table value?..its for radgrid control.Set it as data source for ur control and your done !!
Amit