Make sure that txt_search.Text
is always have some value, either entered by you or default value[e.g. txt_search.Text = "nothing"].
Object reference not set to an instance of an object.
This usually occurs when there is data available to pass further for processing BUT system doesn't understand WHERE to pass it, unless we explicitly Take Care of it.
It's Good. You are using Try Catch & Debugger. Also use
condition to track where the code fails to continue and do some Brainstorm
to save much time in doing debug.
Happy Programming... ;)
How To Code For: