I;m a little new to C# and I've got the following problem. Any help will be really appreciated.
I'm reading a csv file and insering the data into a MySQL Database. I am not to concerned about
records that dont get added to the DB. Unfortunatly when there is an error on the insert due to
problems in the csv file my loop stops working.
Flow is as follows
try
{
read loop
{
set up SQL string and do insert
}
catch(ODBCexception)
{
and in here I would like to go and read the next record in the read loop and continue processing.
}
I've tried putting a goto in the catch to a label inside the read loop but i get an error about the
goto not referencing a a label in its scope. So I'm a little bit stuck at the moment.
I'm kinda looking for something like VB6's "On error resume next".
Thanks in advance
Problem with Try/Catch/Finally
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Andrew Wooster77 pointsPosted Jul 25, 2005, 10:13 AM EDT
ie
read loop
{
try
{
'set up command text and do insert
}
catch
{
'log error or whatever
}
}
Lekker Ou5 pointsPosted Jul 25, 2005, 10:51 PM EDT
Works like a charm.
I suppose its all about learning the complete structure of a language when doing things. I'm still a little
stuck on VB6's ways.