Posts

Showing posts from January 16, 2019

How to Create Dynamic Table in C#

 Create a DataTable object Add Columns Using Add Method Create the object on Row DataTable objdt  = new DataTable();                         dtUnits.Columns.Add("ABCNo",typeof(string));                         dtUnits.Columns.Add("UserName", typeof(string)); var row = objdt  .NewRow();                                 row["ABCNo"] =   ItemNO;                                 row["UserName"] = Aranav;                                 dtUnits.Rows.Add(row);

How to get IP Of Client machine in ASP.Net

IP Of Client machine the following function is used to get IP of Client Machine Public string GetIPOfClient()         {             string returnvalue = string.Empty;             try             {                 System.Web.HttpContext context = System.Web.HttpContext.Current;                 string ip = context.Request.ServerVariables[" HTTP_X_FORWARDED_FOR "];                 returnvalue = context.Request.ServerVariables[" REMOTE_ADDR "];                 if (!string.IsNullOrEmpty(ip))                 {                     string[] addresses = ip.Split(',');           ...

Popular posts from this blog

String Program in C#

CSV using XmlNode

Controller_Model. cs