Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

C# 2005

Posted on 2009-05-05
7
Medium Priority
?
177 Views
Last Modified: 2012-05-06
I am a real novice.  I'll need some help along the way.  There is a code that does not give an error, but still does not populate the combo box list with the states.  I am trying to learn both - use of the TableAdapter and the coding technique

private void frmCustomer_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'kQCStates.States' table. You can move, or remove it, as needed.
         
            this.statesTableAdapter.Fill(this.kQCStates.States);

        }
States table has only one field - abbreviations.

Please help.
0
Comment
Question by:Aquarus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 5

Accepted Solution

by:
Aanvik earned 675 total points
ID: 24305307
http://www.codeproject.com/KB/cs/combobox.aspx

Check this out. This should help you achieve your goal.
0
 
LVL 26

Assisted Solution

by:Anurag Thakur
Anurag Thakur earned 150 total points
ID: 24305371
one question does your table adapter contains the value after the fill call?
0
 

Author Comment

by:Aquarus
ID: 24305740
Reply to AANVIK:

These are references that are currently exist.  When I am trying to use the method you soggested it is saying that"
Error      2      The type or namespace name 'OleDbConnection' could not be found (are you missing a using directive or an assembly reference?)

Please advise.  THank you      
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Aquarus
ID: 24305904
Reply to Raqi0017:
Abbreviations for state are in the table States.  The rest is wnat you see.  If I click on the table adapter  property - I can see preview all the states.
0
 

Author Comment

by:Aquarus
ID: 24306145
What namesapce contains DataViewManager?  Does this concept is true for Visual Studio 2005 C#?
0
 
LVL 9

Assisted Solution

by:tculler
tculler earned 675 total points
ID: 24306807
Aquarus:
The OleDbConnection is in the namespace System.Data.OleDb, so throw a "using System.Data.Oledb" using directive at the top of your program.

Also, the statesTableAdapter queries data and fills itself with the abbreviations of states beforehand, correct? I'm guessing that's what the "TODO" part is meant for.

The DataViewManager should be contained within the System.Data namespace; and yes, it should be valid in Visual Studio 2005.
0
 

Author Comment

by:Aquarus
ID: 24307354
Please take a look at the screenshot and help me provide the correct string for connectionstring.  
DBandConnectionString.doc
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question