Вопрос

Once the databind is completed, I fire off the databound event. I wanted to catch any error that might have occurred so I dont run the StoredProc "sp_UpdatePrintQueueToPrinted".

How do I Catch errors on/before DataBound event?

        protected void ListView1_DataBound(object sender, EventArgs e)
    {
        using (GPEntities gpe = new GPEntities())
        {
            gpe.sp_UpdatePrintQueueToPrinted();              
        }
    }
Это было полезно?

Решение

Note that OnDataBound occurs when databinding ends. OnDataBinding occurs as soon as data binding begins.

Are you trying to catch errors relating to the actual databinding itself? If so, wrap your .DataBind() event with a try catch statement. Or is there some other incidental error that you are tracking as a result of the databinding?

Другие советы

You could use OnDataBinding event which kicks in... on data binding =) (before databound event)

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top