Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ADO.NET For discussion about ADO.NET.††Topics such as question regarding the System.Data namespace are appropriate.††Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old November 4th, 2011, 06:37 PM
Authorized User
Points: 285, Level: 5
Points: 285, Level: 5 Points: 285, Level: 5 Points: 285, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: , , .
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Visual Studio 2005 VB Data Bindings

Hi All,

I am hoping someone can help, it's been a while since I've posted on here and it's been even longer since I've been programming.

Basically I've created a Login Screen and what I'd like to do is the following:

When the login form loads the User Combobox is populated from a users table in SQL. The Selected Item would be "USERNAME" field in the user table and the Selected Value would be the "USERID" field.

Code:
Dim cnTransportSystem As New SqlClient.SqlConnection("Data Source=EXAPPSRV02;Initial Catalog=TransportSystem;Persist Security Info=True;User ID=systemadmin;Password=*********")
Dim cmdUserList As New SqlClient.SqlCommand("SELECT USERID, USERNAME FROM USERS ORDER BY USERNAME", cnTransportSystem)
Dim drUserList As SqlClient.SqlDataReader

cnTransportSystem.Open()
drUserList = cmdUserList.ExecuteReader()
ComboBox1.DataSource = drUserList
ComboBox1.SelectedItem = "USERNAME"
ComboBox1.SelectedValue = "USERID"
drUserList.Close()
cnTransportSystem.Close()
Unfortunately this is not working and I could really do with some guidance from you guys.

This is a Windows Application which I'm creating.

THanks again!!!
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Studio 2005 - VB Windows Mobile 6 Application testsubject Visual Studio 2005 0 December 20th, 2010 12:06 PM
Visual studio 2005(32 bit) code not work in visual studio 2008 on windows server 2008 gr8.jain Visual Basic 2008 Essentials 1 August 31st, 2009 11:07 AM
Deploy CR with Visual Studio 2005 VB.Net clflyer Crystal Reports 0 March 7th, 2007 12:41 PM
Visual Studio 2003 vs. Visual Studio 2005 eitanbarazani C# 2005 4 May 9th, 2006 02:34 AM
Visual Studio .net2003 and Visual Studio 2005 Gert Visual C++ 1 January 24th, 2006 05:10 AM



All times are GMT -4. The time now is 07:44 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.