Have you tried to use "DataError" event of DataGridView control? On Wed, Jul 8, 2009 at 8:02 AM, Benj Nunez <[email protected]> wrote:
> > Hello experts, > > I encountered an issue similar to this: > > http://www.codeguru.com/forum/showthread.php?t=418306 > > > The solution was to put code in the datagridview's Cell event handler > which for me may not be applicable. I have a code like this: > > DataSet dsQueryResult = null; > dsQueryResult = service.doExecuteQuery(txtQueryInput.Text.Trim()); > clearQueryResult(); > > try > { > dgvQueryResult.DataSource = dsQueryResult.Tables[0]; > } > catch (Exception e) > { > // ...doesn't get here > } > > > // an exception gets called afterwards. > > > > I'm developing a program that is similar to a Query Browser for MS > Access. You simply > choose a table then write some sql code in a textbox then press a > button to get > a resultset. The resultset gets displayed to a datagridview. > > The problem I'm having is that it seems there are columns/fields in > the table that > seems to be not being read quite correctly from the datagridview. How > do I trap that exception? > > > > Benj > >
