dbTalk Databases Forums  

Populating a dropdown with a list of members

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


Discuss Populating a dropdown with a list of members in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bob Hug
 
Posts: n/a

Default Populating a dropdown with a list of members - 04-13-2004 , 05:02 PM







I am attempting to populate a dropdown list using the following VB .Net
code:

Dim ds As New DataSet
Dim myCon As New OleDbConnection("Provider=MSOLAP;Integrated
Security=SSPI;Persist Security Info=False;Data Source=dev-sdb-3;Initial
Catalog=HRAnalytics_Demo")
myCon.Open()
Dim sStr As String = "with Member [Measures].[GenderUniqueName] AS
'[Gender].currentmember.UniqueName'" & _
" member [Measures].[GenderDisplayName] as
'Space([Gender].Currentmember.Level.Ordinal * 4) +
Gender.Currentmember.Name'" & _
" SELECT {[Measures].[GenderUniqueName],[Measures].[GenderDisplayName]} on
AXIS(0), {Gender.members} on AXIS(1) " & _
" FROM [EEO Analysis for Candidates Attached to Reqs]"
Dim myDataAdapter As New OleDbDataAdapter(sStr, myCon)
myDataAdapter.Fill(ds)
dd1.DataSource = ds.Tables(0).DefaultView
dd1.DataBind()

What I end up with is four rows in the dropdown like I expect, but the text
"System.Data.DataRowView" instead of the actual data I expect.

If before the databind I add:
dd1.DataTextField = "GenderDisplayName"
dd1.DataValueField = "GenderUniqueName"

the databind then throws the following error:
DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with
the name GenderDisplayName.

Any ideas what I am doing wrong? Is there perhaps something wrong with how I
am specifying "DataTextField" and "DataValueField"

Thanks in advance,
Bob



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.