Hi, i am newbie here and need help. Subject: Multidimmensional 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("mdxTable");
DataRow mdxRow;
Cell cell;
object[] coords = new Object[2];
mdxTable.Columns.Add("Description");
for (int i=0; i<objCellSet.Axes[0].Positions.Count; i++)
{
strColName = objCellSet.Axes[0].Positions[i].Members[0].Caption;
mdxTable.Columns.Add(strColName);
}
Console.WriteLine(objCellSet.Axes[1].Positions.Count);
for (int i=0 ;i<objCellSet.Axes[1].Positions.Count; i++)
{
string val = "";
mdxRow = mdxTable.NewRow();
mdxRow[0] = objCellSet.Axes[1].Positions[i].Members[0].Caption;
for (int j=0; j<objCellSet.Axes[0].Positions.Count; j++)
{
coords[0] = j;
coords[1] = i;
cell = objCellSet.get_Item(ref coords); //<------------ too
slow
string strTemp = cell.FormattedValue;
if ( strTemp == "" || strTemp == null )
val = "0";
else
val = cell.FormattedValue.ToString();
mdxRow[j + 1] = val;
}
mdxTable.Rows.Add(mdxRow);
}
mdxDataSet.Tables.Add(mdxTable); 2 2922
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.com
"Jarek Michałowski" <j.***********@gazeta.pl> wrote in message
news:bo**********@inews.gazeta.pl... Hi, i am newbie here and need help. Subject: Multidimmensional 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("mdxTable");
DataRow mdxRow;
Cell cell; object[] coords = new Object[2];
mdxTable.Columns.Add("Description");
for (int i=0; i<objCellSet.Axes[0].Positions.Count; i++) { strColName = objCellSet.Axes[0].Positions[i].Members[0].Caption; mdxTable.Columns.Add(strColName); }
Console.WriteLine(objCellSet.Axes[1].Positions.Count);
for (int i=0 ;i<objCellSet.Axes[1].Positions.Count; i++) { string val = "";
mdxRow = mdxTable.NewRow();
mdxRow[0] = objCellSet.Axes[1].Positions[i].Members[0].Caption;
for (int j=0; j<objCellSet.Axes[0].Positions.Count; j++) { coords[0] = j; coords[1] = i;
cell = objCellSet.get_Item(ref coords); //<------------
too slow
string strTemp = cell.FormattedValue; if ( strTemp == "" || strTemp == null ) val = "0"; else val = cell.FormattedValue.ToString();
mdxRow[j + 1] = val; } mdxTable.Rows.Add(mdxRow); } mdxDataSet.Tables.Add(mdxTable);
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.com> wrote in
message news:OZ**************@TK2MSFTNGP12.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.com
"Jarek Michałowski" <j.***********@gazeta.pl> wrote in message news:bo**********@inews.gazeta.pl... Hi, i am newbie here and need help. Subject: Multidimmensional 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("mdxTable");
DataRow mdxRow;
Cell cell; object[] coords = new Object[2];
mdxTable.Columns.Add("Description");
for (int i=0; i<objCellSet.Axes[0].Positions.Count; i++) { strColName = objCellSet.Axes[0].Positions[i].Members[0].Caption; mdxTable.Columns.Add(strColName); }
Console.WriteLine(objCellSet.Axes[1].Positions.Count);
for (int i=0 ;i<objCellSet.Axes[1].Positions.Count; i++) { string val = "";
mdxRow = mdxTable.NewRow();
mdxRow[0] = objCellSet.Axes[1].Positions[i].Members[0].Caption;
for (int j=0; j<objCellSet.Axes[0].Positions.Count; j++) { coords[0] = j; coords[1] = i;
cell = objCellSet.get_Item(ref coords); //<------------ too slow
string strTemp = cell.FormattedValue; if ( strTemp == "" || strTemp == null ) val = "0"; else val = cell.FormattedValue.ToString();
mdxRow[j + 1] = val; } mdxTable.Rows.Add(mdxRow); } mdxDataSet.Tables.Add(mdxTable);
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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...
|
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...
|
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...
|
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...
|
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...
| |
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...
|
by: sqlster |
last post by:
Does visual studio express 2005 support adomd.net?
TIA...
|
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...
|
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...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
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...
|
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...
| |
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...
| |