I
Ivan Dimitrov
Hello,
I can't filter integer column in DataView
I have one TextBox that I retreive the value and one ComboBox where I
select column;
When column is string (LastName) everything working very well, but
when I select integer type (AccountNumber) generate an excpetion:
System.Data.EvaluateException: "Cannot perform 'Like' operation on
System.Int32 and System.String"
Thanks in advance
This is my source code:
private void SetUpFilter()
{
this.dvList.RowFilter = null;
if (this.txtFilterName.Text.Length != 0)
{
try
{
if (this.cmbFilterColumns.text.Length == 0)
{
MessageBox.Show("Select column");
return;
}
string filter = "["+ this.cmbFilterColumns.Text + "] LIKE '" +
txtFilterName.Text.ToString() + "%'";
this.dvList.RowFilter = filter;
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
ExceptionManager.Publish(ex);
}
}
}
I can't filter integer column in DataView
I have one TextBox that I retreive the value and one ComboBox where I
select column;
When column is string (LastName) everything working very well, but
when I select integer type (AccountNumber) generate an excpetion:
System.Data.EvaluateException: "Cannot perform 'Like' operation on
System.Int32 and System.String"
Thanks in advance
This is my source code:
private void SetUpFilter()
{
this.dvList.RowFilter = null;
if (this.txtFilterName.Text.Length != 0)
{
try
{
if (this.cmbFilterColumns.text.Length == 0)
{
MessageBox.Show("Select column");
return;
}
string filter = "["+ this.cmbFilterColumns.Text + "] LIKE '" +
txtFilterName.Text.ToString() + "%'";
this.dvList.RowFilter = filter;
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
ExceptionManager.Publish(ex);
}
}
}