dataView

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;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,998
Messages
2,570,242
Members
46,834
Latest member
vina0631

Latest Threads

Top