public void GetMaxsqno() { string message = string.Empty; try { string record = this.Request["record"]; Hashtable ht = JavaScriptConvert.DeserializeObject <Hashtable>(record); BaseBll bll = new BaseBll(); if (ht["emno"].ToString().Equals(string.Empty)) { message = "{status:'success',msg:''}"; } else { int?list = bll.GetMaxsqno(ht["tablename"].ToString(), ht["emno"].ToString()); string sMax = string.Empty; if (!list.HasValue) { sMax = "1"; } else { sMax = Convert.ToString(list + 1); } message = "{status:'success',msg:'" + sMax + "'}"; } } catch (Exception ex) { message = "{status:'fail',msg:''}";; } Response.Output.Write(message); }