<%@ WebHandler Language="C#" Class="DefaultLocationHandler" %> using System; using System.Web; public class DefaultLocationHandler : IHttpHandler { public void ProcessRequest (HttpContext context) { int username = Convert.ToInt32(context.Request.Params["username"].ToString()); decimal password =Convert .ToDecimal ( context.Request.Params["password"].ToString()); decimal email =Convert .ToDecimal ( context.Request.Params["Email"].ToString()); SqlConnection con = new SqlConnection("Data Source=103.21.58.192;Initial Catalog=Helper;User ID=avi_Helper;Password=xyz2515"); con.Open(); string str = @"Insert into [Helper].[dbo].[Default_Location] ([User_Number] ,[Default_Latitude] ,[Default_Longitude]) VALUES ('" + username + "'," + password + "," + email + ")"; SqlCommand cmd = new SqlCommand(str, con); cmd.ExecuteNonQuery(); con.Close(); context.Response.Write("Inserted" + username); } public bool IsReusable { get { return false; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)