Click here to Skip to main content
15,899,475 members
Home / Discussions / C#
   

C#

 
Question[Message Deleted] Pin
rick055631-Aug-09 9:19
rick055631-Aug-09 9:19 
AnswerRe: Change system mouse cursor Pin
Not Active31-Aug-09 9:48
mentorNot Active31-Aug-09 9:48 
AnswerRe: [Message Deleted] Pin
Christian Graus31-Aug-09 15:35
protectorChristian Graus31-Aug-09 15:35 
Question[Message Deleted] Pin
skhan1731-Aug-09 6:41
skhan1731-Aug-09 6:41 
AnswerRe: Dropdown list value is not retaining on page post back Pin
Not Active31-Aug-09 6:49
mentorNot Active31-Aug-09 6:49 
GeneralRe: Dropdown list value is not retaining on page post back Pin
skhan1731-Aug-09 7:12
skhan1731-Aug-09 7:12 
GeneralRe: Dropdown list value is not retaining on page post back Pin
stancrm31-Aug-09 8:19
stancrm31-Aug-09 8:19 
GeneralRe: Dropdown list value is not retaining on page post back Pin
skhan1731-Aug-09 8:48
skhan1731-Aug-09 8:48 
private void Page_Load(object sender, System.EventArgs e)
{
if (this.IsPostBack)
{
getMLNO(Specific_Query_DDL.SelectedItem.Value); //This is where I am generating all the values from the DB for the second dropdown list. And as it's getting post back so even if I click submit button then the page gets post back and the selected value for the second dropdown list gets set to the default value, which is ANY
}
}
private void getMLNO(string selectedvalue) //This is the method where all the MLNOs are generated
{
if(selectedvalue=="ResistantL")
{
string sql= "SELECT re_MLNO, MAX(re_SpecimenDate)-MIN(re_SpecimenDate) AS DaysSeronegative FROM ml_hiv_status WHERE (re_HIV1_Status=0) GROUP BY re_MLNO";

OleDbConnection connection = new OleDbConnection(HIV.Database.DataConstants.CONNECTION_STRING);
OleDbDataAdapter adapter = new OleDbDataAdapter();
OleDbCommand command = new OleDbCommand(sql, connection);

DataSet ds = new DataSet();
adapter.SelectCommand = command;

if (adapter.Fill(ds) > 0)
{
DataView view = ds.Tables[0].DefaultView;
mlno_DDL.DataSource = view;
mlno_DDL.DataValueField="re_MLNO";
mlno_DDL.DataTextField = "re_MLNO";
mlno_DDL.DataBind();
resultsLabel.Visible= true;
mlno_DDL.Items.Insert(0, "ANY");
}
connection.Close();
}
}
private void mlno_DDL_SelectedIndexChanged(object sender, System.EventArgs e)
{
}

private void submitButton_Click(object sender, System.EventArgs e) //SubmitButton_Click method fetches all the data from the Database depending on the 2 values selected from the 2 dropdown list
{
if(Specific_Query_DDL.SelectedItem.Value=="ResistantL")
{
if(mlno_DDL.SelectedItem.Value=="ANY") //All the values from the Db are pulled if ANY is chosen from the second DDL
{
executeResistantListQuery_ANY();
}
else if(mlno_DDL.SelectedItem.Value!="ANY") //Data are pulled if a specific MLNO is chosen from the DB, and this one is not working as always ANY value is chosen from the postback method
{
executeResistantListQuery_MLNO(mlno_DDL.SelectedItem.Value);
}
}

}

Please help. Thank you.
GeneralRe: Dropdown list value is not retaining on page post back Pin
Christian Graus31-Aug-09 12:03
protectorChristian Graus31-Aug-09 12:03 
GeneralRe: Dropdown list value is not retaining on page post back Pin
stancrm31-Aug-09 20:30
stancrm31-Aug-09 20:30 
GeneralRe: Dropdown list value is not retaining on page post back Pin
skhan171-Sep-09 3:09
skhan171-Sep-09 3:09 
AnswerRe: [Message Deleted] Pin
Luc Pattyn31-Aug-09 16:19
sitebuilderLuc Pattyn31-Aug-09 16:19 
QuestionUDP-Server (Connection closed by remote host!?) Pin
softwarejaeger31-Aug-09 5:52
softwarejaeger31-Aug-09 5:52 
GeneralRe: UDP-Server (Connection closed by remote host!?) Pin
harold aptroot31-Aug-09 7:00
harold aptroot31-Aug-09 7:00 
QuestionInterop.Excel (2007) Trouble... Pin
Jacob Dixon31-Aug-09 5:48
Jacob Dixon31-Aug-09 5:48 
AnswerRe: Interop.Excel (2007) Trouble... Pin
Not Active31-Aug-09 6:54
mentorNot Active31-Aug-09 6:54 
GeneralRe: Interop.Excel (2007) Trouble... Pin
Jacob Dixon31-Aug-09 7:51
Jacob Dixon31-Aug-09 7:51 
GeneralRe: Interop.Excel (2007) Trouble... Pin
Not Active31-Aug-09 8:18
mentorNot Active31-Aug-09 8:18 
AnswerRe: Interop.Excel (2007) Trouble... Pin
FilipKrnjic1-Sep-09 4:00
FilipKrnjic1-Sep-09 4:00 
GeneralRe: Interop.Excel (2007) Trouble... Pin
Jacob Dixon1-Sep-09 4:01
Jacob Dixon1-Sep-09 4:01 
QuestionOracle Parser Pin
Fayu31-Aug-09 5:17
Fayu31-Aug-09 5:17 
AnswerRe: Oracle Parser Pin
Richard MacCutchan31-Aug-09 6:16
mveRichard MacCutchan31-Aug-09 6:16 
GeneralRe: Oracle Parser Pin
Fayu31-Aug-09 6:47
Fayu31-Aug-09 6:47 
GeneralRe: Oracle Parser Pin
Richard MacCutchan31-Aug-09 7:12
mveRichard MacCutchan31-Aug-09 7:12 
GeneralRe: Oracle Parser Pin
Fayu31-Aug-09 7:18
Fayu31-Aug-09 7:18 

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.