سؤال

I have:

  • a datagridview (datagridview1).
  • a column in datagridview1 named Phone Number.
  • a bindingsource named (bindingsource1).

This code

bindingsource1.Filter="Phone Number = 123"; 

does not work because there's white space between phone and number!

What to do?

هل كانت مفيدة؟

المحلول

Use square brackets

bindingsource1.Filter="[Phone Number] = 123";

or, preferably, don't use spaces in field-names.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top