Showing posts with label object. Show all posts
Showing posts with label object. Show all posts

Thursday, March 22, 2012

Analysis management object Cubes help

please help me AMO cube making

send me working example of AMO diminsion , cubes

thanks

I think this is what you're asking for:

http://www.codeplex.com/MSFTASProdSamples/Wiki/View.aspx?title=SS2005%21Readme_AMOAdventureWorks&referringTitle=Home

|||

Check here:

http://technet.microsoft.com/en-us/library/ms124924.aspx

Regards!

Monday, March 19, 2012

An instance of the SQL Server Reconciler error object cannot be created

I've got the following server configuration.

Database Server

- Windows 2003 Standard

- MSSQL 2000 sp4

Web Server

- Windows 2003 Standard

- SQL 2000 sp4 replication components

- SQL Mobile 2005 Server tools

The database server published out the snapshot to a share on the web server. This bit is working file, I can see the snapshot contents etc. When I connect from my own pc using SQL Management Studio and attempt to set up a subscription to a Mobile database, I get the following error.

TITLE: Microsoft SQL Server Management Studio

An instance of the SQL Server Reconciler error object cannot be created. Try reinstalling the replication components.
HRESULT 0x8007007E (28010)


BUTTONS:

OK

I've also accessed the Url using diagnostics and get the following output:


SQL Server Mobile Server Agent Diagnostics

2006/01/13 10:09:10
*General Information*Item Value
Server Name bundy
URL /services/taskmobileserversync/sqlcesa30.dll
Authentication Type Anonymous
Server Port 80
HTTPS off
Server Software Microsoft-IIS/6.0
Replication Allowed
RDA Allowed
Logging Level 1

*Impersonation and Access Tests* Action Status ErrorCode
Impersonate User SUCCESS 0x0
ReadWriteDeleteMessageFile SUCCESS 0x0

*SQL Server Mobile Modules Test*Module Status ErrorCode Version
SQLCERP30.DLL SUCCESS 0x0 3.0.5206.0
SQLCESA30.DLL SUCCESS 0x0 3.0.5206.0

*Reconciler Test* Reconciler Status ErrorCode
9.0 Database Reconciler FAILURE 0x80040154
8.0 Database Reconciler FAILURE 0x8007007E

*SQL Server Module Versions* Module Version
sqloledb.dll 2000.85.1022.0
8.0 replrec.dll 2000.80.2038.0
8.0 replprov.dll 2000.80.2038.0
8.0 msgprox.dll 2000.80.2038.0


Any suggestions? I've reinstalled the various components on the Web Server quite a few times by now...

thanks

// charlie

Search for REPLERRX.DLL and register using regsvr32. And then try. If the registration fails for this DLL, just check whether you have all the dependant DLLs. There are tools to find out the dependant DLLs of a particular binary. Most probably you may need to have MSVCR71.DLL and MSVCP71.DLL. However these two DLLs are already packaged in the 'SQL Server 2000 SP4 Replication Components' setup package. There is some problem in the installation I believe. If you could register REPLERRX.DLL, then you should be able to sync.

Thanks,

Laxmi NRO, MSFT, SQL Mobile, Microsoft Corporation

|||To fix this, I installed the SQL Server 2000 client tools. This resolved the problem.|||

Thanks for letting us know the information.

Thanks,

Laxmi Narsimha Rao ORUGANTI, MSFT, SQL Mobile, Microsoft Corporation

Wednesday, March 7, 2012

An array in an object class

In my object class I have an array

Public myArray() as String

I pass this object class as the datasource to reportviewer

How do I access the array from the report? (I'm using reportviewer in visual studio 2005)

Thanks!

I wanted to add that the array is visible from within the report designer, but I can't seem to access items within the array.. I've tried:

Fields!myArray(0).Value, and it just gives an error.. It seems to work with parameters, but not with the data fields... HELP!

Saturday, February 25, 2012

AMO:Why KPI object has an AssociatedMeasureGroupID property?

Hi, friend, please look about this:

I just want to know Why KPI object has an AssociatedMeasureGroupID property?

I think it's very strange. Because the KPI object have a KPIValue and a KPIGoal, and each of them could associate to some measures. As we know,a measure is Under a Measuregroup. That is, a KPI will "associate" to many Measuregroups(2 at least).

Then what's the KPI.AssociatedMeasureGroupID property?

The AssociatedMeasureGroupID is for client applications and specifies the measure group to which the KPI is most strongly associated.

Adrian Dumitrascu

AMO:Quesiton About the DataSourceView

Hi, friends, thank you very much to read my question as below:

I 'am using the AMO, and meet a question about the DataSourceView object.

My question is very simple:

After I added a column into a source table in the SQL Server, how to get the change into the DataSourceView object?

Background:

I have a cube in my OLAP Server, and I connect with it in my application with AMO. My task is to add a new measure, mapping to a new column I just added into the source table, just like this:

Dim meas As Microsoft.AnalysisServices.Measure

meas = Mainform.tDatabase.Cubes(0).MeasureGroups(0).Measures.Add()
meas.Source = CreateDataItem(Mainform.tDatabase.DataSourceViews(0), TableName, ColumnName)

But my problem is that the table schema in the DataSourceViews(0) doesn't include the column just added.

How could I update the DataSourceViews? I tried the Update() method, but that's is used to update the the OLAP server, not what I want to do. I want to update the DataSourceViews object itself refering to the SQL Server's table schema.

Thanks!

Have you added the column to your datatable that you use to populate your DSV ?
|||

sorry, I dont' catch your mean. I have added the column to the source table in the database of the sql server 2005. What is your mean of "MY Datatable use to populate my DSV"? Perhaps, you could teach me how to populate my DSV based on the datatable in the sql server 2005.

Thanks.

|||Hi,

Take a look at this If you scroll down to the part where it says "DataSourceView Objects", you will see that they are using SQL to populate a datatable to fill the datasourceview. This is very similar to what you will do, You've added the new column in the table in your database, now you've got to query that column, to add it to the datatable.

Hope that makes sense,

C

Friday, February 24, 2012

AMO: How to ProcessFull a cube with no processing a Dimention?

Hi, friends, please have a look:

I just add a measure and do an Update to the cube object by AMO, and do a ProcessFull to the cube.

The problem is the ProcessFull will take a very long time. So I want to Process the cube with no processing the Dimentions, Could I do this?

Because I never change the Dimention, why the ProcessFull tot the cube will ALWAY process the dimentions by itself?

Thanks!

Hello! If you add a measure in a fact table you have actually change the whole structure of the cube and all aggregations will have to be rebuilt. That is why you will have to do a full process of the cube.

A full process of a dimension is only required if you change the structure like adding or changing user hierarchies and if you add or delete attributes. If this have not changed you can process(full) the cube and not the dimensions.

Processing dimensions normally takes less time than processing a cube(measure groups or partitions).

Adding calculated measures and other MDX -script objects do not require a full process. You can use process default in the user interface in BIDS to see that. I am not sure what that is called in AMO.

HTH

Thomas Ivarsson

|||

Thanks, Thomas.

Please just processfull the cube in the user interface in BIDS, NOT in AMO. You can see the process result report box, the ProcessFull to the cube will ALWAY make the dimentions be process ed automatically. Why and how to stop this?

|||

Hello! I think this can depend on a setting under "change setting" when you process the cube. Look for something like process affected objects.

HTH

Thomas Ivarsson

|||If you are doing this from BIDS, then adding a measure means you will need to re-deploy and if you have the default options set it will do a processDefault on the whole database. Which means that the cube that has been altered will be fully processed and the dimensions will all have processUpdate run on them to make sure that they have the latest information in them. If you want full control over the processing - do not use BIDS to process. Using XMLA commands from SSMS or ascmd is probably the best way to go. You could also write your own AMO utility in C# or VB.Net if you wanted.|||

Thanks Darren .

Then, you mean If I use AMO, and I use the cube(0).process(processFull), it WILL NOT make the dimention associated to be processed, right?

|||

A full process of a cube will always mean a full process of the dimensions.

HTH

Thomas Ivarsson

|||

ivanchain wrote:

Thanks Darren .

Then, you mean If I use AMO, and I use the cube(0).process(processFull), it WILL NOT make the dimention associated to be processed, right?

You can do cube(0).process(processDefault) to re-process the cube (and because you removed a measure, the Analysis Services server will decide to re-process the full measure group) without re-processing the dimensions. You can also call processDefault on the measure group, but it doesn't hurt to call it on the cube, the server will skip the other measure groups if they don't need to be re-processed.

The ProcessDefault option will only re-process what needs to be re-processed, if you did structural changes or not.

A description of the process types is available at: http://msdn2.microsoft.com/zh-cn/library/microsoft.analysisservices.processtype.aspx

|||

Adrian and Thomas are right, sorry I said processFull, but I was talking about processDefault.

Another good resource on processing is the Processing Architecture whitepaper: http://msdn2.microsoft.com/en-us/library/ms345142.aspx

|||

Thanks. From what you said, it means that I could always use ProcessDefault? Then why we need the ProcessFull?

Anyway, I will use ProcessDefault. OK?

|||

ProcessFull is to force a clean and full re-processing, if you want to do that.

|||

If I can say, I can always use ProcessDefault any time?

Thanks.

AMO: How to ProcessFull a cube with no processing a Dimention?

Hi, friends, please have a look:

I just add a measure and do an Update to the cube object by AMO, and do a ProcessFull to the cube.

The problem is the ProcessFull will take a very long time. So I want to Process the cube with no processing the Dimentions, Could I do this?

Because I never change the Dimention, why the ProcessFull tot the cube will ALWAY process the dimentions by itself?

Thanks!

Hello! If you add a measure in a fact table you have actually change the whole structure of the cube and all aggregations will have to be rebuilt. That is why you will have to do a full process of the cube.

A full process of a dimension is only required if you change the structure like adding or changing user hierarchies and if you add or delete attributes. If this have not changed you can process(full) the cube and not the dimensions.

Processing dimensions normally takes less time than processing a cube(measure groups or partitions).

Adding calculated measures and other MDX -script objects do not require a full process. You can use process default in the user interface in BIDS to see that. I am not sure what that is called in AMO.

HTH

Thomas Ivarsson

|||

Thanks, Thomas.

Please just processfull the cube in the user interface in BIDS, NOT in AMO. You can see the process result report box, the ProcessFull to the cube will ALWAY make the dimentions be process ed automatically. Why and how to stop this?

|||

Hello! I think this can depend on a setting under "change setting" when you process the cube. Look for something like process affected objects.

HTH

Thomas Ivarsson

|||If you are doing this from BIDS, then adding a measure means you will need to re-deploy and if you have the default options set it will do a processDefault on the whole database. Which means that the cube that has been altered will be fully processed and the dimensions will all have processUpdate run on them to make sure that they have the latest information in them. If you want full control over the processing - do not use BIDS to process. Using XMLA commands from SSMS or ascmd is probably the best way to go. You could also write your own AMO utility in C# or VB.Net if you wanted.|||

Thanks Darren .

Then, you mean If I use AMO, and I use the cube(0).process(processFull), it WILL NOT make the dimention associated to be processed, right?

|||

A full process of a cube will always mean a full process of the dimensions.

HTH

Thomas Ivarsson

|||

ivanchain wrote:

Thanks Darren .

Then, you mean If I use AMO, and I use the cube(0).process(processFull), it WILL NOT make the dimention associated to be processed, right?

You can do cube(0).process(processDefault) to re-process the cube (and because you removed a measure, the Analysis Services server will decide to re-process the full measure group) without re-processing the dimensions. You can also call processDefault on the measure group, but it doesn't hurt to call it on the cube, the server will skip the other measure groups if they don't need to be re-processed.

The ProcessDefault option will only re-process what needs to be re-processed, if you did structural changes or not.

A description of the process types is available at: http://msdn2.microsoft.com/zh-cn/library/microsoft.analysisservices.processtype.aspx

|||

Adrian and Thomas are right, sorry I said processFull, but I was talking about processDefault.

Another good resource on processing is the Processing Architecture whitepaper: http://msdn2.microsoft.com/en-us/library/ms345142.aspx

|||

Thanks. From what you said, it means that I could always use ProcessDefault? Then why we need the ProcessFull?

Anyway, I will use ProcessDefault. OK?

|||

ProcessFull is to force a clean and full re-processing, if you want to do that.

|||

If I can say, I can always use ProcessDefault any time?

Thanks.

AMO: How to process after adding a measure?

Hi, friends, please look this:

dim tDatabase as Microsoft.AnalysisServices.DataBase

tDatabase=Mainform.AnalysisDB 'here to refer it to an object

tDatabase..Cubes(0).MeasureGroups(0).Measures.Add() 'here to add a measure

tDatabase..Cubes(0).Update(Microsoft.AnalysisServices.UpdateOptions.ExpandFull)

tDatabase.Process(Microsoft.AnalysisServices.ProcessType.ProcessUpdate)

I want to know if it's correct to use the ProcessType.ProcessUpdate option?

After adding/dropping a measure/KPI, what ProcessType need I use?

After update a dsv, what ProcessType need I use?

Thanks!

To the best of my knowledge processUpdate is only valid for dimensions (see http://msdn2.microsoft.com/en-us/library/ms345142.aspx)

If you add a measure you are changing the structure of the cube which will invalidate the cube, the easiest way to get the cube "fully operational" again would be to do a processFull. The same thing applies when removing a measure.

I don't think you need to do any processing for calculated measures or KPI's as these elements do not have storage structures associated with them.

As far as the DSV is concerned, it depends on the type of change you are making. Changing the DSV will not invalidate the cube structure as such. The DSV is an abstraction for the data source(s) of the cube. It depends on the type of changes you are making. If the data that comes out of the DSV is affected in any way, you would need to re-process the cube to get it to reflect these changes. More importantly, if you change data types or remove elements that other objects such as dimensions, partitions, measures etc. are dependant upon, then you would need to change those objects too and that would most likely require full re-processing.

|||

Thank you Gosbell ,

Please tell me if I drop or add a measure, if I always need to ProcessFull?

As you know, ProcessFull will take a very long time, specially when the cube is huge. I don't think the client could stand the long time just because he/she add or delete a measure thourgh my application with AMO.

How to deal with this problem?

|||

Please tell me if I drop or add a measure, if I always need to ProcessFull?

Yes, you do. You can add and remove calculations easy enough, but adding and removing measures that are linked to fact table columns changes the fundamental data structures. Adding and removing measures to a measureGroup is not really something to be done lightly, especially once a large cube has been deployed.

The bare minimum that you could do to get the cubes "queryable" again would be a processStructure followed by a processData, but the cubes would not have any indexes or aggregations, so they could be quite slow. Doing a processIndex would add the indexes and aggregations, but processFull is the effectively the same as doing all three of these operations individually. You might see a slight performance advantage by doing the three operations individually, but it would not be a dramatic change.

|||I see that. Thanks again, Gosbell!

AMO: how to get a SourceColumnName from a measure object?

Hi, friends, please look this:

In AMO, I can get a measure object:

Dim meas As Microsoft.AnalysisServices.Measure

meas = tDatabase.Cubes(0).MeasureGroups(0).Measures(0)

Dim dt as DataItem= meas.source

Now I want to find the meas' SourceColumnName, that is, the ColumnName of the measure mapped to.

But how? I tried the meas.source's property, but did not find anyone like a Name.

Please help me.

Thanks!

Hi there,

Try

tDatabase.Cubes(0).MeasureGroups(0).Measures(0).Source.Source.ToString()

C

|||

Thanks!|||

The source of a Measure can be either a:

1. ColumnBinding (the common case): this points (with the TableID and ColumnID properties) to a System.Data.DataColumn in the DataSourceView of the Cube (specified in the Cube.Source property). This DataColumn can be either a regular column or a calculated column, there are these special extended properties (in the DataColumn.ExtendedProperties collection) to consider: DbColumnName (provides the real column name in the relational table, this is usually the same with the DataColumn.ColumnName) and DbExpression (provides the SQL expression for a calculated column)

2. RowBinding: used for row count measures, points (with the TableID property) to the System.Data.DataTable in the DataSourceView

3. MeasureBinding: used for linked measures (in a linked measure group), points (with the MeasureID property) to the measure to link

Adrian Dumitrascu

|||

I am trying to , via AMO, get the type of Binding for a measure (column, row, measure) and then return, when the type is columnbinding, the columnid and tableid from the DSV. Could you provide an example?

AMO: how to get a SourceColumnName from a measure object?

Hi, friends, please look this:

In AMO, I can get a measure object:

Dim meas As Microsoft.AnalysisServices.Measure

meas = tDatabase.Cubes(0).MeasureGroups(0).Measures(0)

Dim dt as DataItem= meas.source

Now I want to find the meas' SourceColumnName, that is, the ColumnName of the measure mapped to.

But how? I tried the meas.source's property, but did not find anyone like a Name.

Please help me.

Thanks!

Hi there,

Try

tDatabase.Cubes(0).MeasureGroups(0).Measures(0).Source.Source.ToString()

C

|||

Thanks!|||

The source of a Measure can be either a:

1. ColumnBinding (the common case): this points (with the TableID and ColumnID properties) to a System.Data.DataColumn in the DataSourceView of the Cube (specified in the Cube.Source property). This DataColumn can be either a regular column or a calculated column, there are these special extended properties (in the DataColumn.ExtendedProperties collection) to consider: DbColumnName (provides the real column name in the relational table, this is usually the same with the DataColumn.ColumnName) and DbExpression (provides the SQL expression for a calculated column)

2. RowBinding: used for row count measures, points (with the TableID property) to the System.Data.DataTable in the DataSourceView

3. MeasureBinding: used for linked measures (in a linked measure group), points (with the MeasureID property) to the measure to link

Adrian Dumitrascu

|||

I am trying to , via AMO, get the type of Binding for a measure (column, row, measure) and then return, when the type is columnbinding, the columnid and tableid from the DSV. Could you provide an example?

AMO: About the measure object''s remove method.

hi,friend, please look this:

I have a measure object in AMO.

Dim meas As Microsoft.AnalysisServices.Measure
Meas =tDatabase.Cubes(0).MeasureGroups(0).Measures(0)

tDatabase.Cubes(0).MeasureGroups(0).Measures.Remove(Meas, True)

I just want to know the meaning of the Remove method's second para. Measures.Remove(item as Microsoft.AnalysisServices.Measure, CleanUp as boolean)

What's the CleanUP? The remove method also support to only use the item para. What happened if I set the CleanUP to True/False, or just missing it?

Thanks!

Hi,

The 'cleanUp' boolean argument specifies if the dependent objects will be removed. For a Measure, the dependents include the PerspectiveMeasure objects. For a DimensionAttribute, the dependents include the CubeAttribute objects.

If you do not specify the 'cleanUp' parameter, the dependents are removed.

If you want for example to replace one object with another (having the same ID), then you can use the 'cleanUp'=false argument.

When working connected to the server, the 'cleanUp' argument has limited use, because you cannot save an invalid object or an object that would invalidate other objects in the database. For example, if you chose to remove a Measure with 'cleanUp'=false and dependent PerspectiveMeasures do exist, then you will get an error when trying to save the MeasureGroup (because it will leave the Perspective(s) with broken references).

Adrian Dumitrascu

|||

Thank you very much, Adrian.

As you said,The 'cleanUp' boolean argument specifies if the dependent objects will be removed.

I want to konw, the KPI object is the dependent object to the Measure? When I remove a measure with CleanUp= True, will the KPI associated be removed too? Or Just I need to remove the KPI by myself? If I don't remove the KPI, but removed the measure which associated, will it report an error when I save it to the server?

Thanks again.

|||

> I want to konw, the KPI object is the dependent object to the Measure? When I remove a measure with CleanUp= True, will the KPI associated be removed too?

No, the KPI objects are not removed. If the Value property of the KPI is referring to a certain measure, when you delete that measure, AMO will not parse the Value (nor any Command objects from an MdxScript in the Cube, or other MDX fragments in other objects) to see if the measure is used.

When checking for dependents, AMO only sees direct-defined metadata references; for example: a PerspectiveMeasure has the MeasureID property to reference the Measure, a CubeAttribute has the AttributeID property to reference a DimensionAttribute, a CubeDimension has the DimensionID property to reference a Dimension.

> If I don't remove the KPI, but removed the measure which associated, will it report an error when I save it to the server?

The .Update() method will succeed (because the Analysis Services engine will do a similar dependencies analysis as AMO), but you will get MDX errors when browsing.

Adrian Dumitrascu

|||

very clear!

Thank you, Adrian!

AMO: About the measure object's remove method.

hi,friend, please look this:

I have a measure object in AMO.

Dim meas As Microsoft.AnalysisServices.Measure
Meas =tDatabase.Cubes(0).MeasureGroups(0).Measures(0)

tDatabase.Cubes(0).MeasureGroups(0).Measures.Remove(Meas, True)

I just want to know the meaning of the Remove method's second para. Measures.Remove(item as Microsoft.AnalysisServices.Measure, CleanUp as boolean)

What's the CleanUP? The remove method also support to only use the item para. What happened if I set the CleanUP to True/False, or just missing it?

Thanks!

Hi,

The 'cleanUp' boolean argument specifies if the dependent objects will be removed. For a Measure, the dependents include the PerspectiveMeasure objects. For a DimensionAttribute, the dependents include the CubeAttribute objects.

If you do not specify the 'cleanUp' parameter, the dependents are removed.

If you want for example to replace one object with another (having the same ID), then you can use the 'cleanUp'=false argument.

When working connected to the server, the 'cleanUp' argument has limited use, because you cannot save an invalid object or an object that would invalidate other objects in the database. For example, if you chose to remove a Measure with 'cleanUp'=false and dependent PerspectiveMeasures do exist, then you will get an error when trying to save the MeasureGroup (because it will leave the Perspective(s) with broken references).

Adrian Dumitrascu

|||

Thank you very much, Adrian.

As you said,The 'cleanUp' boolean argument specifies if the dependent objects will be removed.

I want to konw, the KPI object is the dependent object to the Measure? When I remove a measure with CleanUp= True, will the KPI associated be removed too? Or Just I need to remove the KPI by myself? If I don't remove the KPI, but removed the measure which associated, will it report an error when I save it to the server?

Thanks again.

|||

> I want to konw, the KPI object is the dependent object to the Measure? When I remove a measure with CleanUp= True, will the KPI associated be removed too?

No, the KPI objects are not removed. If the Value property of the KPI is referring to a certain measure, when you delete that measure, AMO will not parse the Value (nor any Command objects from an MdxScript in the Cube, or other MDX fragments in other objects) to see if the measure is used.

When checking for dependents, AMO only sees direct-defined metadata references; for example: a PerspectiveMeasure has the MeasureID property to reference the Measure, a CubeAttribute has the AttributeID property to reference a DimensionAttribute, a CubeDimension has the DimensionID property to reference a Dimension.

> If I don't remove the KPI, but removed the measure which associated, will it report an error when I save it to the server?

The .Update() method will succeed (because the Analysis Services engine will do a similar dependencies analysis as AMO), but you will get MDX errors when browsing.

Adrian Dumitrascu

|||

very clear!

Thank you, Adrian!

AMO with VB.Net

Hi All,

I am working on a project that require me to build cubes programmatically i.e., using AMO object and VB.Net. I am trying to find a sample that builds cubes using VB.Net.

I can add further features to it based on the sample.

Can any one help me at their earliest?

Thanks

Sekhar PC

Check the following two links:

http://www.asptoday.com/Content.aspx?id=2351

and

http://sorosjing.cnblogs.com/archive/2005/12/08/292848.html

Have fun.

Yones

|||

Hi,

Thank you for your reply.

When I tried to create a cube by exactly following the sample, always it threw an error "Could not deploy the cube".

Is there a better sample that help to create cube using AMO and dotnet? A sample that get deployed though the source is AdventureWorks only.

Thanks

SekharPC

|||

Thanks for the reply.

When I tried to implement the steps given in the above listed website, everytime I got an error message saying "Could not create cubes". Then I copied and pasted and tried to create cubes using AdventureWorks database. Still the error continued.

Can a better sample be found which I can use to create my cubes dynamically?

An early reply will be of great help to me.

Thanks

SekharPC

|||

There is great C# sample in http://msdn2.microsoft.com/en-us/library/ms345091.aspx

it was very useful for me.

Mohsen

AMO with VB.Net

Hi All,

I am working on a project that require me to build cubes programmatically i.e., using AMO object and VB.Net. I am trying to find a sample that builds cubes using VB.Net.

I can add further features to it based on the sample.

Can any one help me at their earliest?

Thanks

Sekhar PC

Check the following two links:

http://www.asptoday.com/Content.aspx?id=2351

and

http://sorosjing.cnblogs.com/archive/2005/12/08/292848.html

Have fun.

Yones

|||

Hi,

Thank you for your reply.

When I tried to create a cube by exactly following the sample, always it threw an error "Could not deploy the cube".

Is there a better sample that help to create cube using AMO and dotnet? A sample that get deployed though the source is AdventureWorks only.

Thanks

SekharPC

|||

Thanks for the reply.

When I tried to implement the steps given in the above listed website, everytime I got an error message saying "Could not create cubes". Then I copied and pasted and tried to create cubes using AdventureWorks database. Still the error continued.

Can a better sample be found which I can use to create my cubes dynamically?

An early reply will be of great help to me.

Thanks

SekharPC

|||

There is great C# sample in http://msdn2.microsoft.com/en-us/library/ms345091.aspx

it was very useful for me.

Mohsen

AMO with VB.Net

Hi All,

I am working on a project that require me to build cubes programmatically i.e., using AMO object and VB.Net. I am trying to find a sample that builds cubes using VB.Net.

I can add further features to it based on the sample.

Can any one help me at their earliest?

Thanks

Sekhar PC

Check the following two links:

http://www.asptoday.com/Content.aspx?id=2351

and

http://sorosjing.cnblogs.com/archive/2005/12/08/292848.html

Have fun.

Yones

|||

Hi,

Thank you for your reply.

When I tried to create a cube by exactly following the sample, always it threw an error "Could not deploy the cube".

Is there a better sample that help to create cube using AMO and dotnet? A sample that get deployed though the source is AdventureWorks only.

Thanks

SekharPC

|||

Thanks for the reply.

When I tried to implement the steps given in the above listed website, everytime I got an error message saying "Could not create cubes". Then I copied and pasted and tried to create cubes using AdventureWorks database. Still the error continued.

Can a better sample be found which I can use to create my cubes dynamically?

An early reply will be of great help to me.

Thanks

SekharPC

|||

There is great C# sample in http://msdn2.microsoft.com/en-us/library/ms345091.aspx

it was very useful for me.

Mohsen

AMO with VB.Net

Hi All,

I am working on a project that require me to build cubes programmatically i.e., using AMO object and VB.Net. I am trying to find a sample that builds cubes using VB.Net.

I can add further features to it based on the sample.

Can any one help me at their earliest?

Thanks

Sekhar PC

Check the following two links:

http://www.asptoday.com/Content.aspx?id=2351

and

http://sorosjing.cnblogs.com/archive/2005/12/08/292848.html

Have fun.

Yones

|||

Hi,

Thank you for your reply.

When I tried to create a cube by exactly following the sample, always it threw an error "Could not deploy the cube".

Is there a better sample that help to create cube using AMO and dotnet? A sample that get deployed though the source is AdventureWorks only.

Thanks

SekharPC

|||

Thanks for the reply.

When I tried to implement the steps given in the above listed website, everytime I got an error message saying "Could not create cubes". Then I copied and pasted and tried to create cubes using AdventureWorks database. Still the error continued.

Can a better sample be found which I can use to create my cubes dynamically?

An early reply will be of great help to me.

Thanks

SekharPC

|||

There is great C# sample in http://msdn2.microsoft.com/en-us/library/ms345091.aspx

it was very useful for me.

Mohsen

Thursday, February 16, 2012

Amateur SQL formation error

Hi I have the error:

Only assignment, call, increment, decrement, and new object expressions can be used as a statement

Line 29: command.CommandText = "UPDATE Items SET Quantityavailable = '+TextBox1.Text+' + Quantityavailable.ToString()"; "INS...
 
Refering to my poor coding:
 
private bool ExecuteUpdate(int quantity)
{
SqlConnection con = new SqlConnection();
con.ConnectionString = "CustomString";

con.Open();

SqlCommand command = new SqlCommand();
command.Connection = con;
command.CommandText = "UPDATE Items SET Quantityavailable = '+TextBox1.Text+' + Quantityavailable.ToString()"; "INSERT Transactions SET Usersname = '<%# System.Web.HttpContext.Current.User.Identity.Name %>'"; "INSERT Transactions SET Itemid = '@.ProID'"; "INSERT Transactions SET itemname = '@.ItemName'"; "INSERT Transactions SET Date = '<%# DateTime.Now %>'";
command.ExecuteNonQuery();

con.Close();
}

protected void Button2_Click(object sender, EventArgs e)
{
TextBox tb = FormView.FindControl("TextBox1") as TextBox;
ExecuteUpdate( Int32.Parse(tb.Text) );
}

 
Can someone tell me what I've done wrong?
Thanks,
Jon 

What is Quantityavailable.ToString? I don't see that in the code.

Should iot just be

UPDATE Items SET Quantityavailable = '+TextBox1.Text;

|||

Your update statement doesn't specify which item in the items table you want to update.

You have multiple inserts into the transactions table, and you are using the UPDATE syntax for each.

You have quotation problems.

You can't use the databinding syntax in code <% ... %>.

You have parameters defined (@.ProID, @.ItemName) in the SQL, but never declared or set a value for them (And you have them inside quotes).

Try something like (Sorry, not all that good at C#, but it would look something like this):

command.CommandText = "UPDATE Items SET QuantityAvailable = @.qty WHERE ItemID=@.ItemID; INSERT INTO Transactions(Usersname,ItemID,ItemName,[Date]) VALUES (@.User,@.ItemID,@.ItemName,getdate())";

command.Parameters.Add("@.qty",sqldbtypes.Integer).Value = quantity;

command.Parameters.Add("@.User",sqldbtypes.Nvarchar).Value = System.Web.HttpContext.Current.User.Identity.Name;

command.Parameters.Add("@.ItemID",sqldbtypes.Integer).Value = ?;

command.Parameters.Add("@.ItemName",sqldbtypes.NVarchar).Value= ?;

|||

Hi thanks for your response..

The thing is, I am trying to make one table update (Items - Quantityavailable) with the value typed into the textbox, at the same time as another has data inserted (Transactions).


The data to be inserted is databound to the formview of the page - thats why I didnt define the parameters (@....@....) I thought they would just get lifted from the formview as they are defined within the formview. Is there a way to do this?

I have modified my code to this:

SqlConnection con = new SqlConnection();
con.ConnectionString = "CustomString";

con.Open();

SqlCommand command = new SqlCommand();
command.Connection = con;
command.CommandText = "UPDATE Items SET Quantityavailable = +TextBox1.Text' ";
"INSERT INTO Transactions(Usersname,ItemID,ItemName,[Date]) VALUES (@.User,@.ItemID,@.ItemName,getdate())";
command.Parameters.Add("@.User",sqldbtypes.Nvarchar).Value = System.Web.HttpContext.Current.User.Identity.Name;
command.Parameters.Add("@.ItemID",sqldbtypes.Integer).Value = ?;
command.Parameters.Add("@.ItemName",sqldbtypes.NVarchar).Value= ?;

command.ExecuteNonQuery();

con.Close();

Thanks,

Jon

|||

Should be

"UPDATE Items SET Quantityavailable = " +TextBox1.Text + ";"

|||

mcp111:

Should be

"UPDATE Items SET Quantityavailable = " +TextBox1.Text + ";"

Rather, I would recommend using parameterized queries to prevent SQL Injection attacks.

"UPDATE Items SET Quantityavailable = @.Qty"

Monday, February 13, 2012

Am i going the right way about this

Hi,

Im building an application in vb.net 05 and mobile sql. When i added the mobile database in visual studio it added a Dataset object in the object viewer.

Now my question is should i add table adapters to this and do my selects inserts updates and deletes using this, or should i us the sqlceclient class connect to the db use a command object ect and do my operations?

I need it to be as fast as possible and 100 reliable.

Can anyone give me a clue as to the best way forward?

Trev

The automatic creating of bindingsource and datasource datasets is a convenience in VS2005 and you can certainly do most of your interaction with SQL Mobile using this approach. If you want finer-grained control over your interaction with SQL Mobile (for performance tuning for example), then I wouldn't use the auto-generated bindings and instead use SqlCeResultSet, SqlCeDataReader, and SqlCeCommands in TableDirect mode to perform your database operations when possible.

Darren

Thursday, February 9, 2012

alternative for slowly changing dimension (SCD) object

Hi,

I think slowly changing dimension object is not a good choice to update my dimension. It's running slower than I expected. my dimension records has surrogate keys from a control table that SCD is looking up whenever it encounters a new record.

Any alternative I can use?

cherriesh wrote:

Hi,

I think slowly changing dimension object is not a good choice to update my dimension. It's running slower than I expected. my dimension records has surrogate keys from a control table that SCD is looking up whenever it encounters a new record.

Any alternative I can use?

Most people use the techniques described here:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1211340&SiteID=1

-Jamie

|||

Hi Jamie,

I tried to use your example with the lookup to check if record is existing or not. If the record is already existing and has changed, then that means that I have to use the oledb command to update my table? based on the forums i read, this object runs slow. do i have any alternative for this?

http://blogs.conchango.com/jamiethomson/archive/2006/09/12/SSIS_3A00_-Checking-if-a-row-exists-and-if-it-does_2C00_-has-it-changed.aspx

cherriesh|||

See my blog...

there is a post to populate dimensions... different from others...

Regards!

|||

Hi Pedro,

Which one in your blog? can you post the url.

thanks a lot!

cherriesh

|||

cherriesh wrote:

Hi Jamie,

I tried to use your example with the lookup to check if record is existing or not. If the record is already existing and has changed, then that means that I have to use the oledb command to update my table? based on the forums i read, this object runs slow. do i have any alternative for this?

http://blogs.conchango.com/jamiethomson/archive/2006/09/12/SSIS_3A00_-Checking-if-a-row-exists-and-if-it-does_2C00_-has-it-changed.aspx

cherriesh

Cherriesh,

As part of the thread that Jamie posted earlier, there is a discussion on alternatives -- namely loading your updates to a staging table that you later use an Execute SQL task to perform the batch update. Please read through that entire thread.

|||

http://pedrocgd.blogspot.com/2007/05/ssis-populating-dimension_28.html

Helped?

Regards

|||your problem is resolved?!

alternative for slowly changing dimension (SCD) object

Hi,

I think slowly changing dimension object is not a good choice to update my dimension. It's running slower than I expected. my dimension records has surrogate keys from a control table that SCD is looking up whenever it encounters a new record.

Any alternative I can use?

cherriesh wrote:

Hi,

I think slowly changing dimension object is not a good choice to update my dimension. It's running slower than I expected. my dimension records has surrogate keys from a control table that SCD is looking up whenever it encounters a new record.

Any alternative I can use?

Most people use the techniques described here:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1211340&SiteID=1

-Jamie

|||

Hi Jamie,

I tried to use your example with the lookup to check if record is existing or not. If the record is already existing and has changed, then that means that I have to use the oledb command to update my table? based on the forums i read, this object runs slow. do i have any alternative for this?

http://blogs.conchango.com/jamiethomson/archive/2006/09/12/SSIS_3A00_-Checking-if-a-row-exists-and-if-it-does_2C00_-has-it-changed.aspx

cherriesh|||

See my blog...

there is a post to populate dimensions... different from others...

Regards!

|||

Hi Pedro,

Which one in your blog? can you post the url.

thanks a lot!

cherriesh

|||

cherriesh wrote:

Hi Jamie,

I tried to use your example with the lookup to check if record is existing or not. If the record is already existing and has changed, then that means that I have to use the oledb command to update my table? based on the forums i read, this object runs slow. do i have any alternative for this?

http://blogs.conchango.com/jamiethomson/archive/2006/09/12/SSIS_3A00_-Checking-if-a-row-exists-and-if-it-does_2C00_-has-it-changed.aspx

cherriesh

Cherriesh,

As part of the thread that Jamie posted earlier, there is a discussion on alternatives -- namely loading your updates to a staging table that you later use an Execute SQL task to perform the batch update. Please read through that entire thread.

|||

http://pedrocgd.blogspot.com/2007/05/ssis-populating-dimension_28.html

Helped?

Regards

|||your problem is resolved?!