Data Access Application Block and listbox

G

Guest

Hello
I'm using the Data Access Application Block in my code
I'm trying to populate a list box
It works right up to the last step - displaying the datamember
Can someone tell me where the problem lies
Thanks in advance
Ambe

My code is as follows

Dim ConStr As String = "workstation id=LAPTOPAMBER;packet size=4096;integrated security=SSPI;initial catalog=fsAbitibi;persist security info=False
Dim dsACP As DataSet = SqlHelper.ExecuteDataset(ConStr, CommandType.Text,
"SELECT ID_CUTTING_PERMIT, STR_CUTTING_PERMIT, STR_FOREST_DISTRICT, STR_FOREST_REGION, STR_TSA, STR_LICENSEE, STR_LICENSE_NO, STR_OPERATING_AREA, STR_TIMBER_MARK, STR_CATEGORY, DTM_FORECAST, STR_EMPLOYEE, DTM_COMPLETE, STR_SIGN_OFF_BY, DTM_SIGN_OFF, STR_PEER_REVIEW, DTM_PEER_REVIEW, STR_SIGN_OFF_STATUS, STR_SIGN_OFF_COM FROM TDT_CUTTING_PERMIT"

lBoxCP.DataSource = dsAC
lBoxCP.DisplayMember = "TDT_CUTTING_PERMIT.STR_CUTTING_PERMIT"
 
K

Ken Tucker [MVP]

Hi,

Try this.

lBoxCP.DataSource = dsACP.Tables(0)
lBoxCP.DisplayMember = "STR_CUTTING_PERMIT"

Ken
---------------
amber said:
Hello,
I'm using the Data Access Application Block in my code.
I'm trying to populate a list box.
It works right up to the last step - displaying the datamember.
Can someone tell me where the problem lies?
Thanks in advance!
Amber

My code is as follows:

Dim ConStr As String = "workstation id=LAPTOPAMBER;packet
size=4096;integrated security=SSPI;initial catalog=fsAbitibi;persist
security info=False"
Dim dsACP As DataSet = SqlHelper.ExecuteDataset(ConStr, CommandType.Text, _
"SELECT ID_CUTTING_PERMIT, STR_CUTTING_PERMIT,
STR_FOREST_DISTRICT, STR_FOREST_REGION, STR_TSA, STR_LICENSEE,
STR_LICENSE_NO, STR_OPERATING_AREA, STR_TIMBER_MARK, STR_CATEGORY,
DTM_FORECAST, STR_EMPLOYEE, DTM_COMPLETE, STR_SIGN_OFF_BY, DTM_SIGN_OFF,
STR_PEER_REVIEW, DTM_PEER_REVIEW, STR_SIGN_OFF_STATUS, STR_SIGN_OFF_COM FROM
TDT_CUTTING_PERMIT")
 
C

Cor

Hi Amber,

Did you know about this chat tonight (for me)

Wondering about how best to access data from your applications? Then bring
your questions and ask them to experts from the Visual Studio and SQL teams.
Come learn about the best approaches for working with data in your
applications.

Date:
March 2, 2004

Time:
1:00 - 2:00 P.M. Pacific time
4:00 - 5:00 P.M. Eastern time
21:00 - 22:00 BST/BST
(For a list of local time zones relative to GMT, please see
http://msdn.microsoft.com/chats/timezones.asp.)

Outlook Reminder:
http://msdn.microsoft.com/chats/outlook_reminders/VS_Mar2.vcs

Location:
http://msdn.microsoft.com/chats (then click the name of the chat to enter
the chat room)

For more information about Visual Basic .NET, see
http://msdn.microsoft.com/vbasic/
To see a list of upcoming chats or set a reminder for this chat, see
http://msdn.microsoft.com/chats.
For archives of previous chats, see
http://msdn.microsoft.com/chats/recent.asp.

Thanks!
Jason Cooke
VB.NET Team
========
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
(c) 2004 Microsoft Corporation. All rights reserved.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top