.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Post New Web Links

counting a clickthrough

Posted By:      Posted Date: October 10, 2010    Points: 0   Category :ASP.Net

I have a webpage where, when the user clicks a  link to an external site, the clickthrough needs to be recorded in a database table. I've set up the table, which has columns for "id" (key), "featuredid," "featuredurl," and  "ipaddress."

I've set up an .aspx page ("featured-tracking.aspx") to serve as the means of recording the clickthrough before redirecting the user to their destination.

I've configured the URL for the link on the original page so the "featuredid" and "featuredurl" parameters are passed in the URL:


The  insert will be handled by a TableAdapter method I created.

I have two questions. First,  how do I take the parameter values passed in the URL and assign them to the values in my insert statement? And second, how do I get the user's IP address and assign that value to the parameter for the insert?

Here's my code behind as it stands:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

namespace Maine_Innkeeper_Site_2010
    public parti

View Complete Post

More Related Resource Links

does anyone know why is this not working a clock that keeps on counting , it just stays the same whe

i read something about <div tag does anyone know how this is suppose to workany help is welcome, thank you ALSO if i want to do a countdown session timerwill it pretty much be the same thing?  <html> <head> <title></title> <body onload> <form> <script type="text/JavaScript"> <!-- function display() { var d = new Date(); var time = d.getHours(); var time2 = d.getMinutes(); var time3 = d.getSeconds(); document.write(time); document.write(" :"); document.write(time2); document.write(" :"); document.write(time3); alert("hi"); } // --> </script> <input type="button" OnClick="display()" value="Click Me!"/> </form> </body> </head> </html>  

Counting Values in a recordset

A developer in our group is generating a report that returns the following data:   Date FirstName LastName Count  Dinner1 Dinner2 10/16/2010 John   Doe    2 PrimeRib Salmon 10/16/2010 Cletus  Judd    2   Salmon Salmon 10/16/2010 Some   One    2 PrimeRib PrimeRib ...   She needs to get a count for totals in dinner 1 and dinner 2 as follows: Dinner 1 Dinner 2 Salmon 1 Salmon 2 PrimeRib 2 PrimeRib 1 Is there a function in SSRS that can do this.  We can do this in T-SQL if necessary, but it would be more work.  Any suggestions are appreciated.        

Counting columns in a row that meet criteria

I have a view with a large number of columns - about 120.  The view is performing error checking against a table, and each column is another error condition it is checking for.  The possible values are: NULL (no error) "Warning: <blah blah>" for warnings "<blah blah>" for errors   I would like to create a summary view on this view that counts up the number of columns in each status, NOT INCLUDING the first few columns that give general information on the record (such as its ID and file location).  I could write it with a whole lot of case statements, along the lines of: case CheckField1 when null then 0 else 1 end + case CheckField2 when null then 0 else 1 end (etc) and come up with the total number of errors.... but as soon as I add another field to the original view I'd have to come back and fix this.  And that doesn't account for errors versus warnings, so I'd have to do the whole huge case + case statement twice, once looking for not-null and once looking for "warning%" ETA: All of the columns I am interested in are named "check_..." and have the same varchar(1000) data type, if that helps.  The other fields that I do not want to count are named and sized diferently. There's got to be a better way.... and I thought you guys might be able to help point me in the right direction. An

counting page Sessions based on databound grid row - please help

Hi, I would like to count the number of page views. I am able to use the global.asax file and a label to obtain this. However, this gives me the total count of the page. That is great, however I like to count the number of users accessing the page when the user clicks on a particular gridview row value from the previous page. I have a gridview in the gridview a value that links to a new page. This new page contains the row values. I would like to count the number of users who have accessed this new page based on the gridview row value. As such the page count will be different based on each row. Please assist, if anyone has a sample using gridview and a hyperlink to a new page with a session count of that new page that would be fantastic. Thank you in advance. Nijojo.  

Help in counting



How I can get the desired output counting upto 1200.
Starting from 2 and skipping a number after three number i.e. (5,9,13.. are missing)





Counting gridview row in a new page?


Can please someone assist? A sample code how this works would me much appreciated in vb?

I am have created the link in the gridview datarow and have redirected the querystring to a new page, however how do I make the count of the new page based on the querystring? Essentially, I would like to count and display in a textbox the number of times a user has clicked on the selected row.


Thanks in advance.


Counting the number of sessions in a web farm



We have a ASP .NET application which will be deployed in a web farm. We would like to find the total number of sessions that have been established. If we create a counter in global.asax.cs, it will be able to count only within aspnet_wp process. In a web farm, multiple nodes will have IIS on multiple machines.
If we use SQL server-based session management, can we get the total number of active session by querying the Session DB?
If we later decide to use session state server to store the sessions, can we get the number of active sessions?


Counting the unique occurence of a value in a Table


Hi all,


I have a database that lists all of the BUGs and customer cases and various other fields, Every BUG has several cases attached. If I have to get a BUG count for every Unique bug and add ithat column as a bugcount column in the same table. Is this the right way to do it?

Step1: Craete anew table:

SELECT [BUG No], [Fiscal Month], MIN(CaseId) AS CaseID

Increase the counting records


Hi, Following both scripts's last counting record goes less than 1300.
How I can get results more than 2000. Thanks.

with Q as
(select 0 as std union all select 1 union all select 2 union all select 3 union all select 4 union all
select 5 ),tn as
(select ROW_NUMBER() over (Order by (select 1)) as tm from Q Q1,Q Q2,Q Q3,Q Q4)
select * from tn where tm <= 3000 and tm % 4 <> 1

with Q as
(select 0 as Count_1_5_9 union all select 1 union all select 2 union all select 3 union all select 4 union all
select 5 ),tn as
(select ROW_NUMBER() over (Order by (select 5)) as tr from Q Q1,Q Q2,Q Q3,Q Q4)
select * from tn where tr <= 3000  and tr % 4 = 1


Binary Counting


Hello Seniors My Data Structure Is Like This

USERID(PK)               LEFT                RIGHT

001                    |                      |      002   

002                    |        003        |      004     

003                    |        005        |          

004                    |                  &nb

counting selected checkboxes



i have a multi view, inside this multiview, i have a data list with a colum that has checkboxes. 

now, what i want to happen is the user comes along and ticks certain objects that they want, so for example they tick three objects.

when i click NEXT on my multiview i want to be able to count how many boxes are ticked and do something to each of those objects that are ticked. is this possible?

i am working in VB, and am only new at this so simple worded answers and code samples would be appreciated! :)

thanks in advance...

by the way here is the code for my datalist...if u need it?


                <asp:DataList ID="DataList1" runat="server" BackColor="LightGoldenrodYellow" 
                    BorderColor="Tan" BorderWidth="1px" CellPadding="2" 

MDX for counting rows when various dimensions are selected


I am trying to do an average and found that averageofchildren doesn't roll up approrpriately, thus going to the reliable sum/count approach.

I have the measure Cur Commit = SUM([Measure].[Cur Commit] but I am having trouble doing the count. This is what my data woule look like

DevOrg Hierarchy                              Curr Commit


     ERP 4.2                                     1

     ERP 5.1                                      0

     EDW 6.0                              &nbs

Counting a Dim Member Once per Pivot Cell Occurence, not Once per Pivot


Hi.  You can see at http://social.msdn.microsoft.com/Forums/en-US/sqlanalysisservices/thread/0ac77db1-916e-4046-aa9b-ff8d7b949955   how, with Deepak's help,  we went from the first command you see below to the second in adopting an approach to counting Account Numbers. 

Unfortunately ssas seems bent on counting each account number only once which is great when there are no dimensions dragged.  But some dimensions (eg payment date) justify counting a particular account number one additional time for each  dimension member (or combo of different dims) in which that account was active.  Does anybody know of an elegant/efficient/best practice way of doing this?  I think doing it this way would be more like what a user expects of an account number count involved in a pivot.


count (nonempty([Acct Number].[Acct No].[Acct No].members * [Measures].[Paid Amt])) 

modified to account for activity across one, the other or both measures that indicate acct activity:

count (nonempty([Acct Number].[Acct No].[Acct No].members,
{[Measures].[Paid Amt],  [Measures].[Balance]}))

how to start counting from 1 in automatic int increase field after delete table - sqlCE

how to start counting from 1 in automatic int increase field after delete table ?
i have MEN table with 10 rows, if i delete the table (delete from MEN)
and if i insert new row - it start in 11.
how to start from 1  ?
thanks in advance
i work on sqlCE

how to start counting from 1 in automatic int increase field after delete table - sqlCE

how to start counting from 1 in automatic int increase field after delete table ?
i have MEN table with 10 rows, if i delete the table (delete from MEN)
and if i insert new row - it start in 11.
how to start from 1  ?
thanks in advance
i work on sqlCE

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend