开发者

Using Select to filter a dataset that was defined using Wizards in VS 2010?

In VS 2010 I defined a datasource/dataset using the builtin wizards.

Then my form load method has the following code:

this.specialTableAdapter.Connection.ConnectionString = "..top secret..";
this.开发者_开发百科dataDataSet.customerTable.Select("customer_name like 'atwood%' "); 
this.specialTableAdapter.Fill(this.dataDataSet.customerTable);

The problematic line is the 2nd one where I try to 'Select' against a table in the dataset. Do I need to assign the selected values to a new datatable and then assign the new datatable to the tableAdapter?

UPDATE1:

The SELECT statement does not work correctly. The missing piece is the BindSource!

this.specialTableAdapter.Connection.ConnectionString = "..top secret..";
this.specialBindingSource.Filter = "customer_name like 'atwood%' ";
this.specialTableAdapter.Fill(this.dataDataSet.customerTable);


The SELECT statement does not work correctly. The missing piece is the BindSource!

this.specialTableAdapter.Connection.ConnectionString = "..top secret..";     
this.specialBindingSource.Filter = "customer_name like 'atwood%' ";     
this.specialTableAdapter.Fill(this.dataDataSet.customerTable); 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜