tags:

views:

50

answers:

2

Hello expertise!

I am developing a CMS application. Its a very huge deep and with full of configurable features. Current, I am developing it using Asp.net C#, form authentication and by creating UserControls.

There are lot of configurable items need to decide at run time as per user roles and some rules are predefined and some will be defined by Admin at runtime. The all information is stored in DB. I am getting lot of issues with USerControls. I consulted with some other guys who told my approach is wrong, I should go through DB data fetching. I really don't understand what is it? It is something like my all pages will be stores in Database and will construct at runtime and display as per rights?

Could anyone suggest me best approach and if there will be any example please provide?

Any response will be highly appreciated.

A: 

Are you using DataSource binding and etc. to access and read from database? If yes, then you should try avoid it. For example:

  1. Build Query like: "SELECT user_id FROM users WHERE login = ? and password_hash = ?";
  2. Bind parameters 'login' and 'password_hash'
  3. Assume that you use "Statement" variable for query:

    OdbcDataReader result = Statement.ExecuteReader(); //Look for specific database reader for your case    
    while (result.Read()) {
       integer user_id = result.GetInteger(0);
    }
    

Something like that. You can browse more specific database example here: http://www.easysoft.com/developer/languages/csharp/ado-net-odbc.html

Angelius
@Angelius - thans for your example, its just showing Logins etc. But main query is related to populate pages
Rick
Show me than your query and some logic about how this is working at your side, and I can describe a little further
Angelius
Currently we have Stored procedures which are fetching some information and we will display all info in User Controls. Like for User credentials we have spUserCredentials store dprocedure
Rick
A: 

Look at some CMS systems, such as Kentico, Dotnetnuke or Umbraco. They may support out-of-the-box what you're trying to develop by yourself...

David Kochenski