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. Web Development
  3. ASP.NET
  4. how to interact an image to a database value

how to interact an image to a database value

Scheduled Pinned Locked Moved ASP.NET
tutorialdatabase
8 Posts 3 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.
  • D Offline
    D Offline
    duo
    wrote on last edited by
    #1

    i would like to know how to create an application were the image will change color based on the database value(example '1'=red '0'=green) And also a code to insert table in the webform based on the input of columns and rows from a textbox Row: 3 column: 2 next a table with 3 rows and 2 columns are created:):)

    M _ 2 Replies Last reply
    0
    • D duo

      i would like to know how to create an application were the image will change color based on the database value(example '1'=red '0'=green) And also a code to insert table in the webform based on the input of columns and rows from a textbox Row: 3 column: 2 next a table with 3 rows and 2 columns are created:):)

      M Offline
      M Offline
      Mubashir Javaid
      wrote on last edited by
      #2

      Add these three controls to xml page.
      then add this code behid the button on click event DataTable dt = new DataTable(); if (txtColumns.Text.Length > 0) { string[] str = txtColumns.Text.Split(','); foreach (String st in str) { dt.Columns.Add(st); } DataRow dr = dt.NewRow(); dt.Rows.Add(dr); mainDataGrid.DataSource = dt; mainDataGrid.DataBind(); } You can also use switch statement for decision making in selecting color.

      God Bless you. Always do good to others

      D 3 Replies Last reply
      0
      • D duo

        i would like to know how to create an application were the image will change color based on the database value(example '1'=red '0'=green) And also a code to insert table in the webform based on the input of columns and rows from a textbox Row: 3 column: 2 next a table with 3 rows and 2 columns are created:):)

        _ Offline
        _ Offline
        _AK_
        wrote on last edited by
        #3

        duo!@# wrote:

        i would like to know how to create an application were the image will change color based on the database value(example '1'=red '0'=green)

        You can take two image and select the image to the control based on the database criterion.

        duo!@# wrote:

        And also a code to insert table in the webform based on the input of columns and rows from a textbox Row: 3 column: 2 next a table with 3 rows and 2 columns are created

        What you need to do is to create the html table and rows is c# and add it to another parent control like panel.

        Apurva Kaushal

        1 Reply Last reply
        0
        • M Mubashir Javaid

          Add these three controls to xml page.
          then add this code behid the button on click event DataTable dt = new DataTable(); if (txtColumns.Text.Length > 0) { string[] str = txtColumns.Text.Split(','); foreach (String st in str) { dt.Columns.Add(st); } DataRow dr = dt.NewRow(); dt.Rows.Add(dr); mainDataGrid.DataSource = dt; mainDataGrid.DataBind(); } You can also use switch statement for decision making in selecting color.

          God Bless you. Always do good to others

          D Offline
          D Offline
          duo
          wrote on last edited by
          #4

          i'm appricate your promptnes in sending me a reply thank you I prefer using visual basic to c# and converted your code to visual basic from www.codechanger.com does it use 2 textboxes and 1 button does it accept the inputs from the rows and columns:):)

          1 Reply Last reply
          0
          • M Mubashir Javaid

            Add these three controls to xml page.
            then add this code behid the button on click event DataTable dt = new DataTable(); if (txtColumns.Text.Length > 0) { string[] str = txtColumns.Text.Split(','); foreach (String st in str) { dt.Columns.Add(st); } DataRow dr = dt.NewRow(); dt.Rows.Add(dr); mainDataGrid.DataSource = dt; mainDataGrid.DataBind(); } You can also use switch statement for decision making in selecting color.

            God Bless you. Always do good to others

            D Offline
            D Offline
            duo
            wrote on last edited by
            #5

            hi there i would like to know wht the DataTable and DataRow is for:confused::confused:

            M 1 Reply Last reply
            0
            • M Mubashir Javaid

              Add these three controls to xml page.
              then add this code behid the button on click event DataTable dt = new DataTable(); if (txtColumns.Text.Length > 0) { string[] str = txtColumns.Text.Split(','); foreach (String st in str) { dt.Columns.Add(st); } DataRow dr = dt.NewRow(); dt.Rows.Add(dr); mainDataGrid.DataSource = dt; mainDataGrid.DataBind(); } You can also use switch statement for decision making in selecting color.

              God Bless you. Always do good to others

              D Offline
              D Offline
              duo
              wrote on last edited by
              #6

              wht controls are added to the xml page???

              M 1 Reply Last reply
              0
              • D duo

                wht controls are added to the xml page???

                M Offline
                M Offline
                Mubashir Javaid
                wrote on last edited by
                #7

                These are controls for adding. asp:TextBox asp:Button asp:GridView

                God Bless you. Always do good to others

                1 Reply Last reply
                0
                • D duo

                  hi there i would like to know wht the DataTable and DataRow is for:confused::confused:

                  M Offline
                  M Offline
                  Mubashir Javaid
                  wrote on last edited by
                  #8

                  datatable is a logical table in the memory and datarow is logical row in the memory.

                  God Bless you. Always do good to others

                  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