We need a lot more information than "it's telling me Error". What error, exactly, is it giving. What line, exactly, is the error occuring. You should catch specific exceptions, not the generic "catch" you are using. You don't even bother to get the exception object so you can see more information about the problem!
Momerath
Nearly a Senior Poster
3,384 posts since Aug 2010
Reputation Points: 1,232
Solved Threads: 558
I know, but that tells us nothing except there is an exception. Change your catch statement (and following code) to:
catch (Exception ex) {
Console.WriteLine(ex.Message);
if (ex.InnerException != null) {
Console.WriteLine(ex.InnerException.Message);
}
}
Momerath
Nearly a Senior Poster
3,384 posts since Aug 2010
Reputation Points: 1,232
Solved Threads: 558