I am using TableAdapter, but I cannot capture any errors that comes from SQL. Here is a piece of my code:
errorText = "";
DataTable AddFilesResult = new DataTable();
var dockDataAdapter = new Dock.DAL.DockDatasetTableAdapters.Dock_Files_AddTableAdapter();
try
{
AddFilesResult = dockDataAdapter.GetData(
location,
name,
relation
);
}
catch (Exception ex)
{
errorText = ex.Message;
}
I tried checking ‘dockDataAdapter.Connection’, but I don’t see any error info in there as well.
I created my adapter using this example: http://msdn.microsoft.com/en-us/library/aa581776.aspx
I would appreciate your help. Please let me know if you need any more details.
Thanks.
I found the problem – it was in my code :/. Error can be captured as it should – with try/catch statments.