how to interact an image to a database value
-
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:):)
-
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:):)
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
-
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:):)
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
-
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
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:):)
-
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
-
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
-
These are controls for adding. asp:TextBox asp:Button asp:GridView
God Bless you. Always do good to others
-
datatable is a logical table in the memory and datarow is logical row in the memory.
God Bless you. Always do good to others