Review products and earn money. Learn more
Earn advertising credits on boddunan. Click here to learn more.
Articles Programming .Net Function to Fill data in Combobox control in vb.net

Function to Fill data in Combobox control in vb.net

 public Boolean FillCombo(ref DropDownList DD1, string DisplayColumn, string ValuColumn, string TableName)
    {
        try
        {
            string QueryString = "";
            QueryString = "select " + DisplayColumn + "," + ValuColumn + " from " + TableName + " order by " + DisplayColumn;
            cmd = new SqlCommand(QueryString, ObjCn.OpenDb());
            DA = new SqlDataAdapter(cmd);
            DtMain = new DataTable(TableName);
            DA.Fill(DtMain);
            DD1.DataTextField = DisplayColumn;
            DD1.DataValueField = ValuColumn;
            DD1.DataSource = DtMain;
            DD1.DataBind();
            ListItem LtSelect = new ListItem("Select", "0");
            DD1.Items.Insert(0, LtSelect);
            return true;
        }
        catch (Exception ex)
        {
            return false;
        }
        finally
        {
            ObjCn.CloseDB();
            cmd.Dispose();
            DA.Dispose();
        }
    }

User reviews

There are no user reviews for this listing.

To write a review please register or log in.
 
 
 
Author Articles
More from this author:
How to locate a BLOOD GROUP in India‏ (344 Hits)
Miscellaneous > General Reference
There is a website www.bharatbloodbank.com          where u can search for a particular blood group, u'll get thousand of donor addresses....
Fucntion to Get Maximum num from Table in your vb.net Programme (537 Hits)
Programming > .Net
Private Function getmax()         Dim no As Integer         Dim str1 As String         str1 = "select max(CD) from Item"...
Insert Grid Details Code of .net Functions (459 Hits)
Programming > .Net
This is code to insert Grid details in vb.net you can use this function in common class. you also need to declare required variable globally....
Open and Close Connection Code in .net (382 Hits)
Programming > .Net
this is simple example to open and close connection in .net just use it with out hesitation and do not forget to include required name space like...
Assignment and Expression (364 Hits)
Programming > C & C++
//////////////////////////////////////// // The main() function. //////////////////////////////////////// int main() {     // Declare three...
Increment and Decrement Operator in c++ (372 Hits)
Programming > C & C++
#include //////////////////////////////////////// // The main() function. //////////////////////////////////////// int main() {     int Ctr,...
Conditional Operator in C++ (289 Hits)
Programming > C & C++
#include //////////////////////////////////////// // The main() function. //////////////////////////////////////// int main() {     float...
Related Articles
Related Articles:
Desires: control is important (326 Hits)
hilltrekker
Miscellaneous > General Reference
Desires are important in life to move forward but at the same time one must have control over his desires so that those can be chanelized in a proper...
Self- control (227 Hits)
10000001
People & Places > Social Life
Self- controling  is best The Bhagavad Gita says that anger causes loss of memory, loss of consciousness; it is like madness that leads to...
FUNCTION IN C++ PART-2 (235 Hits)
JiraiyaRaj
Education > Computer Science
  FUNCTION IN C++ PART-2 Now we are going continue with FUNCTION IN C++ PART-2 with more explanations regarding Function In C++........lessen...
Function of skin (241 Hits)
10000001
Education > Arts & Science
  Skin care The flexible covering of human or animal body is called skin. It is one of the sense organs of our body. It helps us to feel the...
Function prototype (257 Hits)
santoshkumarsingh
Programming > C & C++
//////////////////////////////////////// #include // Function prototype. void ErrorMsg(); //////////////////////////////////////// // The main()...
Function Prototype Example (with Function arguments) (306 Hits)
santoshkumarsingh
Programming > C & C++
//////////////////////////////////////// #include // Prototype void show(int = 1, float = 2.3, long = 4); ////////////////////////////////////////...
String copy function in c++ (212 Hits)
santoshkumarsingh
Programming > C & C++
//////////////////////////////////////// #include //////////////////////////////////////// // The first version of string_copy()....
Latest Articles
Latest Articles:
Transport System In India (6 Hits)
sajeetharan
People & Places > Social Life
It would be nice to discuss the public transport facilities that we have in our cities.Let me share How much we are satisfied and how we we are...
Device driver (4 Hits)
Binief
Computers & Technology > New Technologies
A device driver represents a computer programme that admits higher-level PC programs to communicate with a machine. It checks the interractions...
Writing an article effectively (3 Hits)
Binief
Miscellaneous > General Reference
Do you would like to know how you are able to compose an article in under thirty minutes? Whenever you would like to be more creative in the...
Be proud of our 'Sardars' ... Must read! (5 Hits)
sunaina badhwar
Entertainment > Jokes & Humour
We all love those santa-banta jokes.But do you know that sikhs are one of the most hard-working and prosperous communities of the world. After...
Asus J 502 (48 Hits)
sunnyrsingh
Reviews > Mobile Phones
The Asus J 502 is a Slider-Touchscreen phone comes with 24MB internal memory and memory can be expanded by microSD card. It has 3 megapixel camera...
Education System In India (19 Hits)
sajeetharan
Education > Careers
Indian Education system is going through progess period and will emerge to be great.Its not easy to spread literacy in a country with population...
Asus Z801 (45 Hits)
sunnyrsingh
Reviews > Mobile Phones
The Asus Z801 is a Clamshell-Touchscreen phone comes with 64MB internal memory and memory can be expanded by microSD card. It has 2 megapixel camera...
Most Read Articles
Most Read Articles:
Money making programs on boddunan.com (10180 Hits)
bnadmin
Boddunan.com is not only a platform to share knowledge and learn from the articles posted by other members but also provides an oportunity to make...
CANDICE BERGEN (9745 Hits)
xaskoiking
People & Places > Celebrities
Hai friends in this article let us discuss about the 5 time Emmy award winner and 2 time Gold Globe award winning American Actress and model CANDICE...
Understanding the Anatomy of Abdominal Muscles (8278 Hits)
soni2006
Education > Medicine & Surgery
To do any exercise correctly you need to know which muscles are involved and the movements they perform. Anatomically locating these...
History of Transportation – Your Complete Guide (8227 Hits)
soni2006
People & Places > Creators
Definition of transportation Transportation is a means of moving people or goods from one place to another. The modern commercial...
Origami (8152 Hits)
ktkps
Miscellaneous > General Reference
We all would at some point in our childhood (and in college) folded papers to make rocket and other things.But we do not know the name for that...
TOP 10 BICEPS EXERCISES PART 1 (7922 Hits)
sapu
Health & Fitness > Yoga & Excercises
Hi friends, well this article is exclusively for those men and may be, who knows even some girls who want to shape up their biceps by simple...
Jallianwala Bagh Massacre (7336 Hits)
xaskoiking
Miscellaneous > General Reference
#) More than 379 dead and 1500 plus were injured..... These are the number of victims of the cruel massacre by  a cruel man called dyer #)Shock...

Trackback(0)

TrackBack URI for this entry

Comments (9)

Subscribe to this comment's feed
...
rakesh
I have done this during my graduation period, thanks for making me realize that I also know a little bit of .NET.
rakesh , February 10, 2010
...
ramkumarktj
you helping to students continuously! continue this service!
ramkumarktj , March 06, 2010
...
FOUZANMOHD
Well written article i liked it very much
FOUZANMOHD , April 19, 2010
...
kdeepti
Hope article would be more readable if some explanation like "What is function" is provided.
kdeepti , April 20, 2010
...
ramkumarktj
cute and useful programsmilies/smiley.gif
ramkumarktj , May 02, 2010
...
akhileshnigam
Very good write up, will help us
akhileshnigam , June 11, 2010 | url
...
glowingsun
Good write up, keep on going
glowingsun , July 01, 2010
...
akhileshnigam
Story is good , need further
akhileshnigam , July 02, 2010
...
ra_k
Thanks for the coding details very useful one..smilies/smiley.gif
ra_k , July 21, 2010

Write comment

smaller | bigger
security image
Write the displayed characters

busy

Sponsored Links

Leader Board

This Week
sajeetharan (2698 Points)
neetu020784 (1708 Points)
sunnyrsingh (892 Points)
jayen (830 Points)
bolisettypradeep (800 Points)
kdeepti (800 Points)
kumaresh (744 Points)
jasmeetsingh (650 Points)
ra_k (597 Points)
kalyani (585 Points)
Last
aasthagupta36 (1932 Points)
neetu020784 (1661 Points)
vijuagrawal (1596 Points)
sunnyrsingh (1263 Points)
kdeepti (1120 Points)
jobin (888 Points)
kalyani (836 Points)
ra_k (634 Points)
kumaresh (516 Points)
kavishanigam (428 Points)
Updated every 1 hour(s)

You are not logged in.

Boddunan Stats

  • 6819 registered
  • 8 today
  • 39 this week
  • 549 this month
  • Last: emad981

Subscribe Newsletter

Server Time