473,657 Members | 2,397 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ADOMD - get_Item() method too slow - why?

Hi, i am newbie here and need help. Subject: Multidimmension al Cube
In the following code I send the sql query to mssql and retrive data to
objCellSet object. My problem is:
In retrive data I have 10 000 records, get_Item() method is too slow, does
anybody knows why? Is any better solution for this problem?

Thanks
Jarek

if (objConn == null)
objConn = new ConnectionClass ();

objConn.Open( strProvider, "", "", 0 );

if (objCellSet == null)
objCellSet = new CellsetClass();

objCellSet.Open ( mdxQuery, objConn );

string strColName = "";

if (mdxDataSet != null)
mdxDataSet = null;

mdxDataSet = new DataSet();

if (mdxTable != null)
mdxTable = null;

mdxTable = new DataTable("mdxT able");

DataRow mdxRow;

Cell cell;
object[] coords = new Object[2];

mdxTable.Column s.Add("Descript ion");

for (int i=0; i<objCellSet.Ax es[0].Positions.Coun t; i++)
{
strColName = objCellSet.Axes[0].Positions[i].Members[0].Caption;
mdxTable.Column s.Add(strColNam e);
}

Console.WriteLi ne(objCellSet.A xes[1].Positions.Coun t);

for (int i=0 ;i<objCellSet.A xes[1].Positions.Coun t; i++)
{
string val = "";

mdxRow = mdxTable.NewRow ();

mdxRow[0] = objCellSet.Axes[1].Positions[i].Members[0].Caption;

for (int j=0; j<objCellSet.Ax es[0].Positions.Coun t; j++)
{
coords[0] = j;
coords[1] = i;

cell = objCellSet.get_ Item(ref coords); //<------------ too
slow

string strTemp = cell.FormattedV alue;
if ( strTemp == "" || strTemp == null )
val = "0";
else
val = cell.FormattedV alue.ToString() ;

mdxRow[j + 1] = val;
}
mdxTable.Rows.A dd(mdxRow);
}
mdxDataSet.Tabl es.Add(mdxTable );
Nov 15 '05 #1
2 2931
Jarek,

Is there a reason why you wont use the ADOMX result set that is returned
from you? You seem to be transferring the results into a DataTable, and you
are basically doing the fill operation on the data container twice. For a
result set for 10000 rows (and who knows how many columns), that can be
expensive.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Jarek Michałowski" <j.***********@ gazeta.pl> wrote in message
news:bo******** **@inews.gazeta .pl...
Hi, i am newbie here and need help. Subject: Multidimmension al Cube
In the following code I send the sql query to mssql and retrive data to
objCellSet object. My problem is:
In retrive data I have 10 000 records, get_Item() method is too slow, does
anybody knows why? Is any better solution for this problem?

Thanks
Jarek

if (objConn == null)
objConn = new ConnectionClass ();

objConn.Open( strProvider, "", "", 0 );

if (objCellSet == null)
objCellSet = new CellsetClass();

objCellSet.Open ( mdxQuery, objConn );

string strColName = "";

if (mdxDataSet != null)
mdxDataSet = null;

mdxDataSet = new DataSet();

if (mdxTable != null)
mdxTable = null;

mdxTable = new DataTable("mdxT able");

DataRow mdxRow;

Cell cell;
object[] coords = new Object[2];

mdxTable.Column s.Add("Descript ion");

for (int i=0; i<objCellSet.Ax es[0].Positions.Coun t; i++)
{
strColName = objCellSet.Axes[0].Positions[i].Members[0].Caption;
mdxTable.Column s.Add(strColNam e);
}

Console.WriteLi ne(objCellSet.A xes[1].Positions.Coun t);

for (int i=0 ;i<objCellSet.A xes[1].Positions.Coun t; i++)
{
string val = "";

mdxRow = mdxTable.NewRow ();

mdxRow[0] = objCellSet.Axes[1].Positions[i].Members[0].Caption;

for (int j=0; j<objCellSet.Ax es[0].Positions.Coun t; j++)
{
coords[0] = j;
coords[1] = i;

cell = objCellSet.get_ Item(ref coords); //<------------ too slow

string strTemp = cell.FormattedV alue;
if ( strTemp == "" || strTemp == null )
val = "0";
else
val = cell.FormattedV alue.ToString() ;

mdxRow[j + 1] = val;
}
mdxTable.Rows.A dd(mdxRow);
}
mdxDataSet.Tabl es.Add(mdxTable );

Nov 15 '05 #2
Hi, I use the datatable to pleace it in dataset which is a datagrid
datasource. I need to display this result in datagrid. In ADOMX result set
is only 4 columns. Is any other method to display ADOMX result set in
datagrid? Or how to display that a lot of data (10 000 records)?

Thanks
Jarek
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:OZ******** ******@TK2MSFTN GP12.phx.gbl...
Jarek,

Is there a reason why you wont use the ADOMX result set that is returned from you? You seem to be transferring the results into a DataTable, and you are basically doing the fill operation on the data container twice. For a
result set for 10000 rows (and who knows how many columns), that can be
expensive.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Jarek Michałowski" <j.***********@ gazeta.pl> wrote in message
news:bo******** **@inews.gazeta .pl...
Hi, i am newbie here and need help. Subject: Multidimmension al Cube
In the following code I send the sql query to mssql and retrive data to
objCellSet object. My problem is:
In retrive data I have 10 000 records, get_Item() method is too slow, does anybody knows why? Is any better solution for this problem?

Thanks
Jarek

if (objConn == null)
objConn = new ConnectionClass ();

objConn.Open( strProvider, "", "", 0 );

if (objCellSet == null)
objCellSet = new CellsetClass();

objCellSet.Open ( mdxQuery, objConn );

string strColName = "";

if (mdxDataSet != null)
mdxDataSet = null;

mdxDataSet = new DataSet();

if (mdxTable != null)
mdxTable = null;

mdxTable = new DataTable("mdxT able");

DataRow mdxRow;

Cell cell;
object[] coords = new Object[2];

mdxTable.Column s.Add("Descript ion");

for (int i=0; i<objCellSet.Ax es[0].Positions.Coun t; i++)
{
strColName = objCellSet.Axes[0].Positions[i].Members[0].Caption;
mdxTable.Column s.Add(strColNam e);
}

Console.WriteLi ne(objCellSet.A xes[1].Positions.Coun t);

for (int i=0 ;i<objCellSet.A xes[1].Positions.Coun t; i++)
{
string val = "";

mdxRow = mdxTable.NewRow ();

mdxRow[0] = objCellSet.Axes[1].Positions[i].Members[0].Caption;

for (int j=0; j<objCellSet.Ax es[0].Positions.Coun t; j++)
{
coords[0] = j;
coords[1] = i;

cell = objCellSet.get_ Item(ref coords); //<------------

too
slow

string strTemp = cell.FormattedV alue;
if ( strTemp == "" || strTemp == null )
val = "0";
else
val = cell.FormattedV alue.ToString() ;

mdxRow[j + 1] = val;
}
mdxTable.Rows.A dd(mdxRow);
}
mdxDataSet.Tabl es.Add(mdxTable );


Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
2849
by: el_roachmeister | last post by:
Is there a way to make a text link post to a form without passing all the parameters in the url? The urls tend to get very long and messy. I often wonder if there is a limit to how long they can get?
3
3425
by: Jonathan Allen | last post by:
What could cause a stack trace like this? Message:Object reference not set to an instance of an object. Stack Trace: at System.Data.DataView.GetRecord(Int32 recordIndex) at System.Data.DataView.get_RowViewCache() at System.Data.DataView.GetElement(Int32 index) at System.Data.DataView.get_Item(Int32 recordIndex) at myCode.myMethod
6
2728
by: Bern McCarty | last post by:
I'm trying to use the VS 2005 March Tech Preview and am trying to adjust some MC++ to the new C++/CLI syntax. I got a little hung up when I encountered the below error. Certainly my 'Bentley::Mstn::Element' type derives ultimately from System::Object. It is a ref class. And upcasting is always implicit right? So I don't understand why I'm getting this error. It's happening on my get method: property Bentley::Mstn::Element^ Item {...
1
2409
by: Steph | last post by:
I am trying to save a simple integer value in ViewState. I set the value in the Page_Load() event and retrieve it in the function Page_Unload() event. The value seems to be set correctly, but upon the next Page_Load(), I get the following error when I try to retrieve the value from ViewState: "function 'ViewState.get_Item' evaluated and returned null". The page does have a form on it with the runat="server" attribute set. From the...
0
1450
by: Mae | last post by:
Dear all, I having a problem here. The situation is as follow, I have a web system with is using C#, if error occur it will capture the error in Global.asax.cs in "Application_Error" and it will kept the error message in a session - Session. In Global.asax.cs it wil redirect to an error page - "ErrorPage.aspx" to display the error message reading from the session.
0
1025
by: Avi Perez | last post by:
Hi I'm new to VB.Net.... could use some advice. I have developed an ActiveX DLL in VB6 that uses ADOMD/ADODB. In call this DLL from my new VB.NET Windows Service app, it automatically creats interop.adomd and interop adodb. When I run the service, it seems that the adomd programming does not work - and I can't get a connection to the different servers.
0
971
by: sqlster | last post by:
Does visual studio express 2005 support adomd.net? TIA...
1
2312
by: Charlotte | last post by:
Hello, We are doing a stability test on our application to prepare for Microsoft SQL Server 2000 certification, and we found a memory leak, but we cannot find its source and fix it. We use an ASP page written in JScript that connects to Analysis Services 2000 using ADOMD and retrieves data from it (this is a very simplified version of our real application that we created just to test the memory leak), see the code below.
0
1449
by: vipul.tankariya | last post by:
We have a .NET application that uses ADOMD to query a MS analysis OLAP cube. In a typical query, we get data for about 3 dimensions (800 x 15 x 2 entities) and then iterate over the resulting cell set to extract information. Occasionally, we see "Object is no longer valid" exceptions being thrown. The object (whose access usually throws this error) is of the type "ADOMD.Position". Sometimes the error appears while executing...
0
8312
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8606
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6169
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4159
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2732
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1959
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1622
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.