G
Guest
Hi
Does anyone know how to set the source of a dtatagrid by means of a query and that the datagrid only shows the columns from the query. I have some code like this
Me.OleDbSelectCommand1.CommandText = "SELECT X, Y " &
"FROM TABLE " &
"WHERE TABLE.[X] = 2
Me.OleDbSelectCommand1.Connection = Me.OleDbConnection
Me.Dataset1.Clear(
Me.OleDbDataAdapter1.Fill(Dataset1
Me.DataGrid1.SetDataBinding(Dataset, "TABLE"
Now the problem is that the datagrid shows all columns of TABLE instead of just the columns X and Y. I'm getting the columns of the complete table. Is it possible to show only the columns X,Y
Thanx...
Does anyone know how to set the source of a dtatagrid by means of a query and that the datagrid only shows the columns from the query. I have some code like this
Me.OleDbSelectCommand1.CommandText = "SELECT X, Y " &
"FROM TABLE " &
"WHERE TABLE.[X] = 2
Me.OleDbSelectCommand1.Connection = Me.OleDbConnection
Me.Dataset1.Clear(
Me.OleDbDataAdapter1.Fill(Dataset1
Me.DataGrid1.SetDataBinding(Dataset, "TABLE"
Now the problem is that the datagrid shows all columns of TABLE instead of just the columns X and Y. I'm getting the columns of the complete table. Is it possible to show only the columns X,Y
Thanx...