Click here to Skip to main content
15,889,813 members
Home / Discussions / C#
   

C#

 
GeneralRe: hey i am tryin to get values from my database into drop down list....but theres some prob wid ma code...can anyone help me out plz Pin
ankitjain111024-Aug-09 21:21
ankitjain111024-Aug-09 21:21 
GeneralRe: hey i am tryin to get values from my database into drop down list....but theres some prob wid ma code...can anyone help me out plz Pin
Suresh Suthar24-Aug-09 21:26
professionalSuresh Suthar24-Aug-09 21:26 
GeneralRe: hey i am tryin to get values from my database into drop down list....but theres some prob wid ma code...can anyone help me out plz Pin
ankitjain111024-Aug-09 23:28
ankitjain111024-Aug-09 23:28 
AnswerRe: hey i am tryin to get values from my database into drop down list....but theres some prob wid ma code...can anyone help me out plz Pin
Suresh Suthar24-Aug-09 21:19
professionalSuresh Suthar24-Aug-09 21:19 
GeneralRe: hey i am tryin to get values from my database into drop down list....but theres some prob wid ma code...can anyone help me out plz Pin
ankitjain111024-Aug-09 21:30
ankitjain111024-Aug-09 21:30 
GeneralRe: hey i am tryin to get values from my database into drop down list....but theres some prob wid ma code...can anyone help me out plz Pin
Suresh Suthar24-Aug-09 21:40
professionalSuresh Suthar24-Aug-09 21:40 
GeneralRe: hey i am tryin to get values from my database into drop down list....but theres some prob wid ma code...can anyone help me out plz Pin
ankitjain111024-Aug-09 21:48
ankitjain111024-Aug-09 21:48 
GeneralRe: hey i am tryin to get values from my database into drop down list....but theres some prob wid ma code...can anyone help me out plz Pin
ankitjain111024-Aug-09 21:52
ankitjain111024-Aug-09 21:52 
protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
{
string connection1 = ConfigurationManager.AppSettings["conn"];
OleDbConnection con1 = new OleDbConnection(connection1);
con1.Open();



OleDbDataReader dr;

string query = "select DISTINCT DEPARTMENT from TIME_DETAILS ";
OleDbDataAdapter da1 = new OleDbDataAdapter(query,con1);
DataSet ds1 = new DataSet();
//da1.Fill(ds1);
OleDbCommand cmd = new OleDbCommand(query,con1);
da1.SelectCommand=cmd;
da1.Fill(ds1,"dept");
DataTable dep=ds1.Tables["dept"];
dr = cmd.ExecuteReader();
DropDownList2.DataSource=dep;
if(dep.Rows.Count>0)
{
foreach (DataRow row in dep.Rows )
{DropDownList2.Items.Add(row[0].ToString());}

}
//while (dr.Read())
//{
//DropDownList2.Items.Add(dr[0].ToString());
//DropDownList2.DataValueField.Insert(dr[0]);
// DropDownList2.Items.Add(New ListItem(dr[0].ToString())));
// }



}

i tried dis too...but its also not helping....no values r shown in the drop down list.plz help me
GeneralRe: hey i am tryin to get values from my database into drop down list....but theres some prob wid ma code...can anyone help me out plz Pin
Suresh Suthar25-Aug-09 3:53
professionalSuresh Suthar25-Aug-09 3:53 
QuestionMouseEnter, MouseLeave on Rectangles Pin
Xmen Real 24-Aug-09 21:05
professional Xmen Real 24-Aug-09 21:05 
AnswerRe: MouseEnter, MouseLeave on Rectangles Pin
stancrm24-Aug-09 21:49
stancrm24-Aug-09 21:49 
GeneralRe: MouseEnter, MouseLeave on Rectangles Pin
Xmen Real 24-Aug-09 22:33
professional Xmen Real 24-Aug-09 22:33 
GeneralRe: MouseEnter, MouseLeave on Rectangles Pin
stancrm24-Aug-09 22:49
stancrm24-Aug-09 22:49 
QuestionProgrammatically get a PDF from a Reporting Service Pin
anderslundsgard24-Aug-09 20:25
anderslundsgard24-Aug-09 20:25 
AnswerRe: Programmatically get a PDF from a Reporting Service Pin
Giorgi Dalakishvili25-Aug-09 1:37
mentorGiorgi Dalakishvili25-Aug-09 1:37 
GeneralRe: Programmatically get a PDF from a Reporting Service Pin
anderslundsgard25-Aug-09 2:23
anderslundsgard25-Aug-09 2:23 
QuestionToolStripContainer ContentPanel visibility Pin
vhassan24-Aug-09 19:59
vhassan24-Aug-09 19:59 
Questionerror in code for data adapter Pin
myinstincts24-Aug-09 19:36
myinstincts24-Aug-09 19:36 
AnswerRe: error in code for data adapter Pin
Suresh Suthar24-Aug-09 19:49
professionalSuresh Suthar24-Aug-09 19:49 
AnswerRe: error in code for data adapter Pin
Ravi Kakumani24-Aug-09 21:09
Ravi Kakumani24-Aug-09 21:09 
QuestionThe work is done,why does Process.WaitForExit() still block the thread? Pin
Morven Huang24-Aug-09 19:32
Morven Huang24-Aug-09 19:32 
AnswerRe: The work is done,why does Process.WaitForExit() still block the thread? Pin
Jimmanuel25-Aug-09 2:27
Jimmanuel25-Aug-09 2:27 
QuestionConverting Unmanaged Handle to Managed Control Pin
Ali Beirami24-Aug-09 18:13
Ali Beirami24-Aug-09 18:13 
AnswerRe: Converting Unmanaged Handle to Managed Control Pin
Christian Graus24-Aug-09 19:29
protectorChristian Graus24-Aug-09 19:29 
QuestionHow to create exe file? Pin
nudma24-Aug-09 18:09
nudma24-Aug-09 18:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.