InvokeSearch on Customer Adapter with Criteria

I have seen this too, try using

Opts.PreLoadSearchFilter = wClause;

Jim Kinneman
Senior Consultant
Encompass Solutions

--- In vantage@yahoogroups.com, Joe Rojas <jrojas@...> wrote:
>
> Hello,
>
>
>
> I'm trying to retrieve the customer's name after a user enters the
> Customer ID in a text box.
>
>
>
> When I try to run the code below, it is seeming to ignore the where
> clause and retreieves all customers and then returns the name of the
> first customer in the list.
>
> What am I doing wrong that it is ignoring the where clause?
>
>
>
> CustomerAdapter adCustomers = new CustomerAdapter(oTrans);
>
> SearchOptions opts = new SearchOptions(SearchMode.AutoSearch);
>
> opts.DataSetMode = DataSetMode.ListDataSet;
>
> string wClause = "CustID = '" + txtCustID2.Text + "'";
>
> opts.NamedSearch.WhereClauses.Add("Customer", wClause);
>
>
>
> adCustomers.InvokeSearch(opts);
>
> edvProj.dataView[edvProj.Row]["Character04"] =
> adCustomers.CustomerList.Tables[0].Rows[0]["Name"].ToString();
>
>
>
> [Non-text portions of this message have been removed]
>
Hello,



I'm trying to retrieve the customer's name after a user enters the
Customer ID in a text box.



When I try to run the code below, it is seeming to ignore the where
clause and retreieves all customers and then returns the name of the
first customer in the list.

What am I doing wrong that it is ignoring the where clause?



CustomerAdapter adCustomers = new CustomerAdapter(oTrans);

SearchOptions opts = new SearchOptions(SearchMode.AutoSearch);

opts.DataSetMode = DataSetMode.ListDataSet;

string wClause = "CustID = '" + txtCustID2.Text + "'";

opts.NamedSearch.WhereClauses.Add("Customer", wClause);



adCustomers.InvokeSearch(opts);

edvProj.dataView[edvProj.Row]["Character04"] =
adCustomers.CustomerList.Tables[0].Rows[0]["Name"].ToString();



[Non-text portions of this message have been removed]