XAML/WPF was desinged from ground up with the MVVM pattern in mind. You can work without it, but all those nice solutions won't work. I wrote a short introduction back in the days:
Let's talk about MVVM
Please put your code into codeblock (7th formating option).
Also give us the excact line of the exception, it's type, it's message and the stacktrace.
Since you only want one value from the DB, just use SQLCommand.ExecuteScalar() with your current Query. If it is not a table, a reader serves no purpose.