Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. [Message Deleted]

[Message Deleted]

Scheduled Pinned Locked Moved C#
9 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    skhan17
    wrote on last edited by
    #1

    [Message Deleted]

    N L 2 Replies Last reply
    0
    • S skhan17

      [Message Deleted]

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      First, this is the wrong forum, you should use the ASP.NET forum as this question is ASP.NET, not C# in general Second, we're not going review all of you code. Describe your problem and include the relevant bits, not everything.


      only two letters away from being an asset

      S 1 Reply Last reply
      0
      • N Not Active

        First, this is the wrong forum, you should use the ASP.NET forum as this question is ASP.NET, not C# in general Second, we're not going review all of you code. Describe your problem and include the relevant bits, not everything.


        only two letters away from being an asset

        S Offline
        S Offline
        skhan17
        wrote on last edited by
        #3

        I am sorry for posting it here...I am deleting the post from here....and to my defense I would say that I thought this much code would be needed to see what I am trying to do here. Though it might seem to be a very unprofessional way to some of us.

        L 1 Reply Last reply
        0
        • S skhan17

          I am sorry for posting it here...I am deleting the post from here....and to my defense I would say that I thought this much code would be needed to see what I am trying to do here. Though it might seem to be a very unprofessional way to some of us.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Just info : 1. Do some debugging, and give us only the line, where exception/error is thrown. 2. If we see a lot of code, then we just skip it, sometimes we have no times to review all of your codes.

          S 1 Reply Last reply
          0
          • L Lost User

            Just info : 1. Do some debugging, and give us only the line, where exception/error is thrown. 2. If we see a lot of code, then we just skip it, sometimes we have no times to review all of your codes.

            S Offline
            S Offline
            skhan17
            wrote on last edited by
            #5

            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

            C L 2 Replies Last reply
            0
            • S skhan17

              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

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              skhan17 wrote:

              if (this.IsPostBack) { getMLNO(Specific_Query_DDL.SelectedItem.Value);

              This will reset the selected item. This is still not the ASP.NET forum.

              Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

              1 Reply Last reply
              0
              • S skhan17

                [Message Deleted]

                L Offline
                L Offline
                Luc Pattyn
                wrote on last edited by
                #7

                Please do not delete a message, it creates a mess and is against the rules. When you're satisfied or no longer interested, edit the message to indicate so in the subject line. :)

                Luc Pattyn

                :badger: :jig: :badger:

                Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.

                :jig: :badger: :jig:

                1 Reply Last reply
                0
                • S skhan17

                  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

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  Wrong forum. Go to ASP.NET forum.

                  S 1 Reply Last reply
                  0
                  • L Lost User

                    Wrong forum. Go to ASP.NET forum.

                    S Offline
                    S Offline
                    skhan17
                    wrote on last edited by
                    #9

                    Thank you all for your suggestion and very strong criticism. This is posted in ASP.NET as well and I don't want to have any reply anymore. Thanks again.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups