E
Esperanza
Hello .net expert, I've made a litle reserch function which allow the user
to find a client by name
or phone number (both are string format) .
Even if I know the value exist, the datagrid return me nothing.
Any Idea what would be the problem ??
Thanks in advance !!
Esperanza
//---------------------------------------------------------------------
private void btnLookFor_Click(object sender, System.EventArgs e)
{
string strVar;
string strSelection;
strVar = this.txtLookFor.Text;
strSelection = this.RadListLookFor.SelectedItem.Text;
try
{
if (strVar.Trim()!=null)
{
//See witch radio button was click
switch(strSelection)
{
//Look by name
case "Name":
this.dataViewGPPL.RowFilter = "XABALPH like '%" + strVar + "%'";
break;
//Look by phone number
case "No tel.":
this.dataViewGPPL.RowFilter = "XTEL like '" + strVar + "'";
break;
}
this.DataGrid1.DataSource = dataViewGPPL;
this.DataGrid1.DataBind();
}
}
catch (Exception ex)
{
throw ex;
}
to find a client by name
or phone number (both are string format) .
Even if I know the value exist, the datagrid return me nothing.
Any Idea what would be the problem ??
Thanks in advance !!
Esperanza
//---------------------------------------------------------------------
private void btnLookFor_Click(object sender, System.EventArgs e)
{
string strVar;
string strSelection;
strVar = this.txtLookFor.Text;
strSelection = this.RadListLookFor.SelectedItem.Text;
try
{
if (strVar.Trim()!=null)
{
//See witch radio button was click
switch(strSelection)
{
//Look by name
case "Name":
this.dataViewGPPL.RowFilter = "XABALPH like '%" + strVar + "%'";
break;
//Look by phone number
case "No tel.":
this.dataViewGPPL.RowFilter = "XTEL like '" + strVar + "'";
break;
}
this.DataGrid1.DataSource = dataViewGPPL;
this.DataGrid1.DataBind();
}
}
catch (Exception ex)
{
throw ex;
}