Get Field Dynamically

Posted by Riyazhaider under Sql Server on 3/26/2015 | Points: 10 | Views : 289 | Status : [Member] | Replies : 2
I have a web application in which i display some alert or information based on database. to display a new parameter or
some new fields i have to modify source code and then deploy the application. is there any way by which i can dynamically add parameters thorough admin module or any other method so that i should be able to display new fields on the fly.
Need urgent solution.


Posted by: Sheonarayan on: 3/26/2015 [Administrator] HonoraryPlatinum | Points: 25

Hi Riyaz,

The approach should be to get all columns to display from the database to UI layer and display to the UI based on what user has selected or what you have set to display (you can store your selected column somewhere in the text file or any other file).

I have a similar example written in this article

Have a look at above article, that must help.


Sheo Narayan

Riyazhaider, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajnilari2015 on: 3/31/2015 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 25

Yes possible. Build the web page at runtime and build the tables where you want to display the data at runtime. So depending on what you want to display, it must be. Below is a pseudo code

e.g. 1.aspx
<div id="myDiv" runat="server" />



var x = "";
string str = "<html><head></head><body><table border='1'><tr><td>Name</td><td>Age</td></tr>";
for(int i=0;i<10;i++)
x =+ "<td>" + string.Concat("Name",i) + "</td><td>" + string.Concat("Age",i) + "</td>";

str+= x;
str += "</table></body></html>";

//finally add it to the div tag

Also you may follow the below links for more clarity

Thanks & Regards,
RNA Team

Riyazhaider, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response