Click here to Skip to main content
15,899,475 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionASP.NET session has expired Pin
Elizma8-Feb-09 23:48
Elizma8-Feb-09 23:48 
QuestionInstallation software needs befor configure dbMail Pin
Guvera8-Feb-09 23:42
Guvera8-Feb-09 23:42 
Questionbutton image Pin
billcodes8-Feb-09 23:11
billcodes8-Feb-09 23:11 
AnswerRe: button image Pin
N a v a n e e t h8-Feb-09 23:25
N a v a n e e t h8-Feb-09 23:25 
AnswerRe: button image Pin
Sneha Bisht9-Feb-09 1:39
Sneha Bisht9-Feb-09 1:39 
AnswerRe: button image Pin
sepel9-Feb-09 4:37
sepel9-Feb-09 4:37 
AnswerRe: button image Pin
Ranjit Viswakumar9-Feb-09 16:44
Ranjit Viswakumar9-Feb-09 16:44 
Questionwe are lost the impressions Pin
r aa j8-Feb-09 23:08
r aa j8-Feb-09 23:08 
hi all ,

I am developing advertising Website-Registering Impression,click etc..here problem is whenever user registering Impression that we are loss the 40% impression and here we doing geolocation also.I attached following code also..Plz reply me if u know...Thanks


using System;
using System.Data;
using System.Data.SqlClient;
using dataacesslayer;
using System.Web;

public partial class Admin_getbase : System.Web.UI.Page
{
string Crid = "";
SqlConnection conn = null;
SqlCommand cmdinsert = null;
protected void Page_Load(object sender, EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
SqlParameter paramvalue;
conn = new SqlConnection("Data Source=dddd;Initial Catalog=new;User ID=fg;Password=hg");


if (Request.QueryString["Crid"] != null)
{
Crid = Request.QueryString["Crid"].ToString();
}
try
{
cmdinsert = new SqlCommand("sd_Basreg", conn);
cmdinsert.CommandType = CommandType.StoredProcedure;
paramvalue = new SqlParameter("@Crid", SqlDbType.Int);
paramvalue.Direction = ParameterDirection.Input;
paramvalue.Value = Crid;
cmdinsert.Parameters.Add(paramvalue);

paramvalue = new SqlParameter("@IpNum", SqlDbType.BigInt);
paramvalue.Direction = ParameterDirection.Input;
paramvalue.Value = IpAddress();
cmdinsert.Parameters.Add(paramvalue);
conn.Open();
cmdinsert.ExecuteNonQuery();
Response.ContentType = "text/plain"; Response.Write("&imp=registered&");
}
catch (Exception ex)
{
cmdinsert = new SqlCommand("sd_Basreg", conn);
cmdinsert.CommandType = CommandType.StoredProcedure;
paramvalue = new SqlParameter("@Crid", SqlDbType.Int);
paramvalue.Direction = ParameterDirection.Input;
paramvalue.Value = Crid;
cmdinsert.Parameters.Add(paramvalue);

paramvalue = new SqlParameter("@IpNum", SqlDbType.BigInt, 50);
paramvalue.Direction = ParameterDirection.Input;
paramvalue.Value = "0";
cmdinsert.Parameters.Add(paramvalue);
conn.Open();
cmdinsert.ExecuteNonQuery();
Response.ContentType = "text/plain"; Response.Write("&imp=registered&");
}
finally
{
cmdinsert.Dispose();
conn.Close();
if (conn.State == ConnectionState.Open)
{
conn.Close();
conn.Dispose();
}
}
}
private string IpAddress()
{
string IPCity = "";
string strIpAddress;
strIpAddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];

string IpAddress = strIpAddress;
Array IpPart = IpAddress.Split('.');

Int64 IpNum = 16777 * Convert.ToInt64(IpPart.GetValue(0)) + 636 * Convert.ToInt64(IpPart.GetValue(1)) + 26 * Convert.ToInt64(IpPart.GetValue(2)) + Convert.ToInt64(IpPart.GetValue(3));

return IpNum.ToString();
}
}



Create PROCEDURE [dbo].[sd_Basreg]
@Crid int,@IpNum varchar(50)

AS
begin
Insert into S_Base(CrId,IpNum) values(@Crid,@IpNum);
end


Please reply me ...if any optimizing code for this

Raaj

AnswerRe: we are lost the impressions Pin
N a v a n e e t h8-Feb-09 23:14
N a v a n e e t h8-Feb-09 23:14 
GeneralRe: we are lost the impressions Pin
r aa j8-Feb-09 23:22
r aa j8-Feb-09 23:22 
QuestionHtmlInputPassword could not be set !!! Pin
papy-boom8-Feb-09 22:35
papy-boom8-Feb-09 22:35 
QuestionImg at run time (Asp.net 2.0) Pin
BalasubramanianK8-Feb-09 22:34
BalasubramanianK8-Feb-09 22:34 
AnswerRe: Img at run time (Asp.net 2.0) Pin
N a v a n e e t h8-Feb-09 23:07
N a v a n e e t h8-Feb-09 23:07 
GeneralRe: Img at run time (Asp.net 2.0) Pin
BalasubramanianK8-Feb-09 23:24
BalasubramanianK8-Feb-09 23:24 
GeneralRe: Img at run time (Asp.net 2.0) Pin
N a v a n e e t h8-Feb-09 23:30
N a v a n e e t h8-Feb-09 23:30 
GeneralRe: Img at run time (Asp.net 2.0) Pin
BalasubramanianK9-Feb-09 0:00
BalasubramanianK9-Feb-09 0:00 
GeneralRe: Img at run time (Asp.net 2.0) Pin
N a v a n e e t h9-Feb-09 0:30
N a v a n e e t h9-Feb-09 0:30 
GeneralRe: Img at run time (Asp.net 2.0) Pin
BalasubramanianK9-Feb-09 0:39
BalasubramanianK9-Feb-09 0:39 
AnswerRe: Img at run time (Asp.net 2.0) Pin
sepel9-Feb-09 4:41
sepel9-Feb-09 4:41 
QuestionTextbox text changed/ Keypress event Pin
5fingers8-Feb-09 21:44
5fingers8-Feb-09 21:44 
AnswerRe: Textbox text changed/ Keypress event Pin
N a v a n e e t h8-Feb-09 22:04
N a v a n e e t h8-Feb-09 22:04 
AnswerRe: Textbox text changed/ Keypress event Pin
sepel9-Feb-09 4:42
sepel9-Feb-09 4:42 
AnswerRe: Textbox text changed/ Keypress event Pin
Ranjit Viswakumar9-Feb-09 16:50
Ranjit Viswakumar9-Feb-09 16:50 
Questionhow to get file .. Pin
anujbanka17848-Feb-09 21:18
anujbanka17848-Feb-09 21:18 
AnswerRe: how to get file .. Pin
N a v a n e e t h8-Feb-09 21:43
N a v a n e e t h8-Feb-09 21:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.