update tablename set ViewCount = ViewCount + 1 where recordid -5
Regards, Raja, USA
private int GetCounterValue() { StreamReader ctrFile; FileStream ctrFileW; StreamWriter sw; string strPath = Server.MapPath( "myappcounter.txt"); string strCounterContents; int nCounter; if (File.Exists(strPath)) { ctrFile = File.OpenText(strPath); strCounterContents = ctrFile.ReadLine().ToString(); ctrFile.Close(); nCounter = Convert.ToInt32(strCounterContents); } else nCounter = 0; nCounter++; ctrFileW = new FileStream(strPath, FileMode.OpenOrCreate,FileAccess.Write); sw = new StreamWriter(ctrFileW); sw.WriteLine(Convert.ToString(nCounter)); sw.Close(); ctrFileW.Close(); return nCounter; }
LP MER
Login to post response