Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

C# 2005

Posted on 2009-05-05
7
Medium Priority
?
180 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
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
Technology Partners: 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

876 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