Click here to Skip to main content
15,917,176 members
Home / Discussions / C#
   

C#

 
AnswerRe: which control to use to add thousands of records in that control in c#.net windows based application Pin
Nagy Vilmos9-Feb-09 1:20
professionalNagy Vilmos9-Feb-09 1:20 
GeneralRe: which control to use to add thousands of records in that control in c#.net windows based application Pin
EliottA9-Feb-09 2:20
EliottA9-Feb-09 2:20 
AnswerRe: which control to use to add thousands of records in that control in c#.net windows based application Pin
#realJSOP9-Feb-09 6:00
professional#realJSOP9-Feb-09 6:00 
QuestionHow to Send SMS with Sender Name ? Pin
Aghosh Babu9-Feb-09 0:30
Aghosh Babu9-Feb-09 0:30 
AnswerRe: How to Send SMS with Sender Name ? Pin
EliottA9-Feb-09 1:59
EliottA9-Feb-09 1:59 
GeneralRe: How to Send SMS with Sender Name ? Pin
Aghosh Babu9-Feb-09 2:10
Aghosh Babu9-Feb-09 2:10 
GeneralRe: How to Send SMS with Sender Name ? Pin
EliottA9-Feb-09 2:11
EliottA9-Feb-09 2:11 
GeneralRe: How to Send SMS with Sender Name ? Pin
Aghosh Babu9-Feb-09 2:18
Aghosh Babu9-Feb-09 2:18 
GeneralRe: How to Send SMS with Sender Name ? Pin
EliottA9-Feb-09 2:20
EliottA9-Feb-09 2:20 
GeneralRe: How to Send SMS with Sender Name ? Pin
benjymous9-Feb-09 3:27
benjymous9-Feb-09 3:27 
GeneralRe: How to Send SMS with Sender Name ? Pin
EliottA9-Feb-09 3:36
EliottA9-Feb-09 3:36 
GeneralRe: How to Send SMS with Sender Name ? Pin
Dan Neely9-Feb-09 4:19
Dan Neely9-Feb-09 4:19 
AnswerRe: How to Send SMS with Sender Name ? Pin
Yosh_13-Feb-10 2:24
professionalYosh_13-Feb-10 2:24 
Questionhow can i avoid interactive services dialog in vista Pin
arun_pk9-Feb-09 0:07
arun_pk9-Feb-09 0:07 
AnswerRe: how can i avoid interactive services dialog in vista Pin
Tom Deketelaere9-Feb-09 0:21
professionalTom Deketelaere9-Feb-09 0:21 
Questionwe are lossing the Impression Pin
r aa j8-Feb-09 23:06
r aa j8-Feb-09 23:06 
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 lossing the Impression Pin
Ken Mazaika9-Feb-09 2:26
Ken Mazaika9-Feb-09 2:26 
Questiontrim Pin
arkiboys8-Feb-09 22:06
arkiboys8-Feb-09 22:06 
AnswerRe: trim Pin
Christian Graus8-Feb-09 22:08
protectorChristian Graus8-Feb-09 22:08 
AnswerRe: trim Pin
arun_pk8-Feb-09 22:29
arun_pk8-Feb-09 22:29 
GeneralRe: trim Pin
arkiboys8-Feb-09 22:31
arkiboys8-Feb-09 22:31 
QuestionCreating sql database by using Link???? Pin
omegazafer8-Feb-09 21:28
omegazafer8-Feb-09 21:28 
AnswerRe: Creating sql database by using Link???? Pin
N a v a n e e t h8-Feb-09 21:59
N a v a n e e t h8-Feb-09 21:59 
GeneralRe: Creating sql database by using Link???? Pin
omegazafer9-Feb-09 0:01
omegazafer9-Feb-09 0:01 
AnswerRe: Creating sql database by using Link???? Pin
Ken Mazaika9-Feb-09 2:34
Ken Mazaika9-Feb-09 2:34 

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.