dbTalk Databases Forums  

Re: Run 2 MDX statements using the same connection obj in ADOMD.Net?

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Re: Run 2 MDX statements using the same connection obj in ADOMD.Net? in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: Run 2 MDX statements using the same connection obj in ADOMD.Net? - 06-01-2006 , 09:13 AM






In article <5A0EF4D4-A44E-458E-9DD4-EB24F3984F82 (AT) microsoft (DOT) com>,
Prasad (AT) discussions (DOT) microsoft.com says...
Quote:

Not possible - you would need to open 2 connections to run 2 statements
at the same time.

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell


Reply With Quote
  #2  
Old   
=?Utf-8?B?UHJhc2Fk?=
 
Posts: n/a

Default Re: Run 2 MDX statements using the same connection obj in ADOMD.Ne - 06-01-2006 , 10:29 AM






Hi Darren,

I would llike to run 2 MDX statements one after another in the same DLL.

The first MDX gives me count of the rows. This count is used for pagination
purposes while displaying on the screen.

The second one is used to actually spin through the cellset for the content.

I will open one connection run the first MDX, then pass the same connection
object as an argument to a different method in the same class that actually
generates the cell set content.

Please let me know.

Thanks,

Prasad.

"Darren Gosbell" wrote:

Quote:
In article <5A0EF4D4-A44E-458E-9DD4-EB24F3984F82 (AT) microsoft (DOT) com>,
Prasad (AT) discussions (DOT) microsoft.com says...



Not possible - you would need to open 2 connections to run 2 statements
at the same time.

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell


Reply With Quote
  #3  
Old   
Mary Potapova [MS]
 
Posts: n/a

Default Re: Run 2 MDX statements using the same connection obj in ADOMD.Net - 06-01-2006 , 05:03 PM



hello Prasad,

i don't think there is any issue with executing more than 1 command against
the same connection sequentially.
so, say you have connection - your opened connection, then what you could
do:

AdomdCommand cmd1 = connection.CreateCommand();
cmd1.CommandText= "<mdx query>";
CellSet cs1 = cmd1.ExecuteCellSet();

AdomdCommand cmd2 = connection.CreateCommand();
cmd2.CommandText = "<another query>";
CellSet cs2 = cmd2.ExecuteCellSet();

or even easier - you don't really need to create another command, you can
re-use the same:

AdomdCommand cmd = connection.CreateCommand();
cmd.CommandText = "<query 1>";
CellSet cs1 = cmd.ExecuteCellSet();
cmd.CommandText = "<query 2>";
CellSet cs2 = cmd.ExecuteCellSet();

either should work i believe.
are you seeing any specific issue? if so, could you specify what it is, and
what the code is doing?

thanks,
-- mary
--
This posting is provided "AS IS" with no warranties, and confers no rights.
--
"Prasad" <Prasad (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi Darren,

I would llike to run 2 MDX statements one after another in the same DLL.

The first MDX gives me count of the rows. This count is used for
pagination
purposes while displaying on the screen.

The second one is used to actually spin through the cellset for the
content.

I will open one connection run the first MDX, then pass the same
connection
object as an argument to a different method in the same class that
actually
generates the cell set content.

Please let me know.

Thanks,

Prasad.

"Darren Gosbell" wrote:

In article <5A0EF4D4-A44E-458E-9DD4-EB24F3984F82 (AT) microsoft (DOT) com>,
Prasad (AT) discussions (DOT) microsoft.com says...



Not possible - you would need to open 2 connections to run 2 statements
at the same time.

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell




Reply With Quote
  #4  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: Run 2 MDX statements using the same connection obj in ADOMD.Net - 06-02-2006 , 03:27 AM



Executing in serial is not an issue. I assumed you were asking the
question because you were trying to run in parallel.

As Mary said - Are you seeing any specific issues?

I would not expect to see too much benefit in running one query to get a
row count and then another to get the data.

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell

In article <#lmGHdchGHA.764 (AT) TK2MSFTNGP03 (DOT) phx.gbl>,
marypo (AT) online (DOT) microsoft.com says...
Quote:
hello Prasad,

i don't think there is any issue with executing more than 1 command against
the same connection sequentially.
so, say you have connection - your opened connection, then what you could
do:

AdomdCommand cmd1 = connection.CreateCommand();
cmd1.CommandText= "<mdx query>";
CellSet cs1 = cmd1.ExecuteCellSet();

AdomdCommand cmd2 = connection.CreateCommand();
cmd2.CommandText = "<another query>";
CellSet cs2 = cmd2.ExecuteCellSet();

or even easier - you don't really need to create another command, you can
re-use the same:

AdomdCommand cmd = connection.CreateCommand();
cmd.CommandText = "<query 1>";
CellSet cs1 = cmd.ExecuteCellSet();
cmd.CommandText = "<query 2>";
CellSet cs2 = cmd.ExecuteCellSet();

either should work i believe.
are you seeing any specific issue? if so, could you specify what it is, and
what the code is doing?

thanks,
-- mary
--
This posting is provided "AS IS" with no warranties, and confers no rights.
--
"Prasad" <Prasad (AT) discussions (DOT) microsoft.com> wrote in message
newsA09B21A-C893-4487-8F0C-A6B4782FC5FD (AT) microsoft (DOT) com...
Hi Darren,

I would llike to run 2 MDX statements one after another in the same DLL.

The first MDX gives me count of the rows. This count is used for
pagination
purposes while displaying on the screen.

The second one is used to actually spin through the cellset for the
content.

I will open one connection run the first MDX, then pass the same
connection
object as an argument to a different method in the same class that
actually

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.