How do I open a MSAccess Crosstab view and bind it to a DataGrid
am 23.09.2005 21:36:01 von pat
I have an MSAccess database that I have used to create a cross tab querry.
When I try and bind it to a datagrid unsing an OleDbDataAdapter or
OleDbDataReader the data grid only displays two of the many column headers
and none of the data. I am not haveing trouble binding to other queries in
the same database. I did note that in the Visual Studio .Net Server explorer
if I make a connection to the database it lists the Crosstab querry as a
stored procedure not a view. I have also tried using an OleDbCommand of
CommandType StoredProcedure but still no luck. Any help would be appreciated.
Re: How do I open a MSAccess Crosstab view and bind it to a DataGrid
am 23.09.2005 22:13:58 von reb01501
Pat wrote:
> I have an MSAccess database that I have used to create a cross tab
> querry. When I try and bind it to a datagrid
There was no way for you to know it, but this is a classic asp newsgroup.
While you may be lucky enough to find a dotnet-savvy person here who can
answer your question, you can eliminate the luck factor by posting your
question to a newsgroup where the dotnet-savvy people hang out. I suggest
microsoft.public.dotnet.framework.aspnet.
However, read on:
> unsing an
> OleDbDataAdapter or OleDbDataReader the data grid only displays two
> of the many column headers and none of the data.
I think your problem is due to the lack of fixed column names from the
crosstab query.
> I am not haveing
> trouble binding to other queries in the same database. I did note
> that in the Visual Studio .Net Server explorer if I make a connection
> to the database it lists the Crosstab querry as a stored procedure
> not a view.
In Access, only simple select statements qualify to be views. Every other
type of saved query is a stored procedure.
> I have also tried using an OleDbCommand of CommandType
> StoredProcedure but still no luck. Any help would be appreciated.
If you can count on a static list of column names being returned from the
crosstab, you can try creating a query that uses the saved crosstab query as
its source, and try binding to the new query. If that does not work, you
will need to post to one of the dotnet groups, perhaps
microsoft.public.dotnet.framework.adonet would be more relevant.
I have a feeling you may have to programmatically add the data to the grid
rather than using databinding (I know: you don't really want to hear that).
But get some input from the more experienced .Net developers on the other
lists before taking that step.
HTH,
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Re: How do I open a MSAccess Crosstab view and bind it to a DataGrid
am 23.09.2005 22:16:11 von reb01501
Bob Barrows [MVP] wrote:
> If you can count on a static list of column names being returned from
> the crosstab, you can try creating a query that uses the saved
> crosstab query as its source, and try binding to the new query.
I should clarify this: don't use "select *" in the new query. Explicitly
name the columns that the query will be sending to the client.
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.