DataView

  • Thread starter Thread starter Charles A. Lackman
  • Start date Start date
C

Charles A. Lackman

Hello,

I have Two Tables in a dataset (Table1 and Table2). I have created a
relationship (MyRelationship) and created a View (MyView) from them. I am
able to display the data the way I want but I am trying to setup a search
function.

I can search anything in Table1 without a problem.

MyView.Sort = "ColumnName"
MyView.Find("1234")

However,

I would like to do a search on Table2 from inside the same View.

Like this (which does not work)

MyView.Sort = "Table2.ColumnName"
MyView.Find("1234")

Or Bind the Data To a ComboBox (which doesn't work either)

ComboBox.Datasource = MyView
ComboBox.DisplayMember = "Table2.ColumnName"

Thanks,

Chuck
 
Hello,

I was able to populate the ComboBox using:
cboSearch.DataSource = MyView.Table.DataSet.Tables("Table1")

Now I need to sort the data in the above table within the view.

Any Suggestions,

Chuck



Hello,

I have Two Tables in a dataset (Table1 and Table2). I have created a
relationship (MyRelationship) and created a View (MyView) from them. I am
able to display the data the way I want but I am trying to setup a search
function.

I can search anything in Table1 without a problem.

MyView.Sort = "ColumnName"
MyView.Find("1234")

However,

I would like to do a search on Table2 from inside the same View.

Like this (which does not work)

MyView.Sort = "Table2.ColumnName"
MyView.Find("1234")

Or Bind the Data To a ComboBox (which doesn't work either)

ComboBox.Datasource = MyView
ComboBox.DisplayMember = "Table2.ColumnName"

Thanks,

Chuck
 
Charles.

MyView.Table.Dataset.Tables("Table1").DefaultView is the Dataview from this
table.

Cor
 
Hello,

Whoops, I meant :

cboSearch.DataSource = MyView.Table.DataSet.Tables("Table2")

But Anyway, I figured out what I needed. I am useing a DataViewManager.

Thanks,

Chuck

Charles.

MyView.Table.Dataset.Tables("Table1").DefaultView is the Dataview from this
table.

Cor
 
Back
Top