Learn more about IndiaStudyChannel
Install Alexa Toolbar
and earn more...
Forum
Resources
Mentors
Projects
Entrance Exams
Question Papers
Colleges
Courses
Universities
Schools
Make Money
Communities
Members
Bookmarks
Polls
Fresher Jobs
Funny Photos
B.Tech Projects
New Member FAQ
My Profile
Sign In
Register
AdSense Revenue
Active Members
Today
Girish Patil
(482)
aravind
(356)
gautham shenoy
(305)
Last 7 Days
Girish Patil
(2479)
S.Baburaj
(1815)
pradeep
(1488)
more...
Awards & Gifts
Online Exams
Aptitude Questions
General Aptitude Tests
Medical Entrance
Engineering Entrance
Bank Tests
TOEFL & IELTS Questions
Fresher Jobs
Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi
Resources
Find educational articles, blogs, discussion threads and other resources.
Colleges
Find details about any college in India or search for courses.
getting data from data base to dropdownlist in dot net
Posted Date: 15 May 2008
Resource Type:
Articles/Knowledge Sharing
Category:
Computer & Technology
Author:
sri phani kumari
Member Level:
Gold
Rating:
Points
: 1
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Populate1();
Populate2();
}
public void Populate1()
{
SqlCommand cmd = new SqlCommand("SELECT * FROM [tblOne]", new SqlConnection(ConfigurationManager.AppSettings["ConnString"]));
cmd.Connection.Open();
SqlDataReader ddlValues;
ddlValues = cmd.ExecuteReader();
DropDownList1.DataSource = ddlValues;
DropDownList1.DataValueField = "theName";
DropDownList1.DataTextField = "theName";
DropDownList1.DataBind();
cmd.Connection.Close();
cmd.Connection.Dispose();
}
public void Populate2()
{
SqlCommand cmd = new SqlCommand("SELECT * FROM [tblOne]", new SqlConnection(ConfigurationManager.AppSettings["ConnString"]));
cmd.Connection.Open();
SqlDataReader ddlValues;
ddlValues = cmd.ExecuteReader();
DropDownList2.DataSource = ddlValues;
DropDownList2.DataValueField = "theCity";
DropDownList2.DataTextField = "theCity";
DropDownList2.DataBind();
cmd.Connection.Close();
cmd.Connection.Dispose();
}
}
Responses
No responses found. Be the first to respond and make money from
revenue sharing program
.
Feedbacks
Popular Tags
What are tags ?
Search Tags
Sign In
(No tags found.)
Post Feedback
This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must
Sign In
to post a response.
Next Resource:
css program
Previous Resource:
windows commands very useful to computer users to make speed
Return to Discussion Resource Index
Post New Resource
Category:
Computer & Technology
Post resources and
earn money
!
Related Resources
Will Extra RAM add value
Computer Abbreviations 1
C Program to Read records from a file using structure
Rename Recycle Bin
IBM 1620
Live Chat Help
Watch TV Channels
Watch Asianet online
Kairali TV in Internet
Surya TV online
Amritha TV Channel
Contact Us
Editors
Privacy Policy
Terms Of Use
ISC Technologies. 2006 - 2008 All Rights Reserved.