tags:

views:

65

answers:

0

we have a small problem, we are trying to store a institutes proxy URL into a database, we are able to identify the URL correctly but as soon as we try and store that value in a database it only stores the original URL rather than the ProxyURL below is the code for reference

protected void checkProxyUrl(string login)
{
    string mainURL =  Request.Url.PathAndQuery;     
    string strIP = Request.UserHostAddress.ToString();
    if (mainURL != "")
    {
        string strPage = mainURL.Substring(0, mainURL.LastIndexOf("/"));

                Response.Write(hdURL.Value+"<br/>");//this value prints the proxyURL http://exproxy.mydomain.com
                SD.LLBLGen.Pro.ORMSupportClasses.IPredicateExpression objFilter = new SD.LLBLGen.Pro.ORMSupportClasses.PredicateExpression();
                objFilter.Add(ppweb.FactoryClasses.PredicateFactory.CompareValue(ppweb.ProxyAccessFieldIndex.ProxUrl,                   SD.LLBLGen.Pro.ORMSupportClasses.ComparisonOperator.Equal, hdURL.Value));
                DataTable dt = ppweb.CollectionClasses.ProxyAccessCollection.GetMultiAsDataTable(objFilter, 0, null);
                if (dt.Rows.Count == 0)
                {
                    Response.Write(hdURL.Value);
                    ppweb.EntityClasses.ProxyAccessEntity objProxy = new ppweb.EntityClasses.ProxyAccessEntity();
                    objProxy.ProxUrl = hdURL.Value; //this value just inserts the original URL i.e. http://mydomain.com instead of http://exproxy.mydomain.com
                    objProxy.Login = login;
                    objProxy.DateAdded = DateTime.Now;
                    objProxy.IsAllowed = true;
                    objProxy.Save();
                }
                createXML();

        }
    }
}