Error handling with datasource and gridview

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I use the new datasource and gridview controls to present data - without
writing a single line of code...But what about error handling? If there is
access denied to the SQL server, if the stored procedure that is called does
not exist, etc. - the need for error handling is indisputable. Surely there
must be some way of adding error handling when filling the gridview? Or must
I return to the 'old' way of filling data in a grid in order to be able to
wrap it in a try...catch ?

Furthermore I have a problem with setting the style of the header in the
gridview. I have set the AllowSorting to true, which makes the headers act as
links. The headers are made bold, and I don't want this, but nomatter what I
do, it does not change. The code in my skin file is here:

<asp:GridView runat="server" BackColor="White" CellPadding="1"
GridLines="Vertical" Font-Names="Verdana, Ariel" Font-Size="7pt" >
<FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
<RowStyle BackColor="#E7EBEF" ForeColor="Black" />
<SelectedRowStyle BackColor="#008A8C" Font-Bold="False"
ForeColor="White" />
<PagerStyle BackColor="#999999" ForeColor="Black"
HorizontalAlign="Center" />
<HeaderStyle BackColor="#d6dfef" Font-Bold="False"
ForeColor="Black" />
<AlternatingRowStyle BackColor="#d6dfef" />
</asp:GridView>

I hope someone is able to help me.
Thanks,
Dorte
 
Dorte,

What do you mean by "the 'old' way.

The only thing that is in the wizard part included now is that it creates a
datatableadapter.fill and you can set using the designer more properties.

VS2005 is not MS Frontpage, the control how the data is handled is AFAIK up
to your own decission by code.

I am still curious what you mean?

Cor
 
Back
Top