How can I search for empty space in the textbox and if it is one i need to display error message. This is for the prevent user the enter filename with space.
You can always just replace any spaces with no space...
In VB it would be....
Replace(myTextBox.Text, " ", "")
And in C# it would be.....
myTextBox.Text.Replace(" ", "");
Hope this helps,