문제

I am having a Search.aspx page which is going to display the records from user entered search criteria. It get the connects to the Specific Database amongst 50 SQLServer Databases. Depending upon the QueryString passed i.e Search.aspx?ID=1 it will connect to 1MyDB Database. if Search.aspx?ID=2 then connect to 2MyDB database which reside on same or different server.This works fine.

The problem i need to display the total count of visitors depending upon the querystring in URL. for these Different Databases that are accessed from same page i.e Search.aspx

Plz suggest me the best method to get the total Visitors for that specific ID.

Whether to Store it in DB by creating a new table and insert the count. OR Set about 50 Application Variables in Global.asax file and get the counter accordingly.

Help Appreciated...!

도움이 되었습니까?

해결책

50 variables doesn't look good. You're going to have a lot of work to show it, and you have to change the code if you add another database. A table is better. Create a table with id and count fields, and every time a page is being hit check if the id is already in the table. If so, increase the row count field. If not, add the id with count = 1.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top