Showing posts with label facing. Show all posts
Showing posts with label facing. Show all posts

Wednesday, March 7, 2012

How to retrieve Member Properties in vb.net 2003 from MS AS 2000

Hi All,

We are facing one problem while retrieving member properties from MSAS 2000 using MDX query in VB.Net. we are able to retrieve the member properties like [Account].[All Account].[Net Income].[Total Expense] but i need the value should come like in this format [Account].[All Account].&[5000].&[5100] which is the member key value.

We are using ADOMD to connect MSOLAP and passing MDX query to retrieve the member properties. The below code which i used to retrieve in VB.Net.

Current Environment is VB.Net 2003 Framework, ADOMD and ADODB.

For intDimCount = 0 To cst.Axes(0).DimensionCount - 1

For intMem = 0 To cst.Axes(0).Positions.Count - 1

arrMem.Add(cst.Axes(0).Positions(intMem).Members(intDimCount).Caption)

arrMem.Add(cst.Axes(0).Positions(intMem).Members(intDimCount).UniqueName)

arrMem.Add(cst.Axes(0).Positions(intMem).Members(intDimCount).Name)

Next

Next

Could you please anyone to advise the same to retrieve member poperties( Name & Unique Name) like this [Account].[All Account].&[5000].&[5100].

Thanks,

Vishwesh

You can control the way the unique name is returned by adding a parameter to the connection string. This KB article explains the details http://support.microsoft.com/default.aspx/kb/304337

In AS2000 I think there was also a registry key setting, but the connection string option is probably better as then your application will be in control of how the unique names are formatted.

|||

Hi Darren,

I am Very thakful to u r reply.It is really helped to solve our Problem.

Friday, February 24, 2012

how to retriece single record in database by using SqlDataSource??

Is me again,and now i facing problem to retrieve a single record from the database.

here is my code:

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim user As String
user = TextBox1.Text
Dim varpassword
Dim mydata As SqlDataSource

mydata.SelectCommand = "Select * from tbluser where uLogin = '" & user & "'"
varpassword = mydata.SelectCommand.uPassword

End Sub
End Class

but i get the error : 'uPassword' is not a member of 'String'

i wan to retrieve the password of that user,can anyone help me?

thanksSmile

First create a select parameter "uPassword" of type "String".

|||

Girijesh:

First create a select parameter "uPassword" of type "String".

i not really understand about creating the select parameter.

can u write the line of code for me?thanksSmile

|||

Hi there,

Use this:

imports System.Data.Sql

Dim dt as new DataTable

Dim query As String = "Select * from tbluser where uLogin = '" & user & "'"

Dim conn as new SqlConnection(connection)

Dim adapter as new SqlDataAdapter

adapter.SelectCommand =new SqlCommand(query, conn);
adapter.Fill(dt);

// this DataTable only has one row, the one for this username

Dim password As String = dt.rows(0)("uPassword")

hope it helps you out,

gonzzas