473,385 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Exception "Function does not exist" calling existing function in Webservice (Json)

The exception is "Function does not exist".But the fuction is actually exist and which is already working in a button click.A particular user only have the permission to do this.And in button click which is written using conditions.Is there any problem of mysql function permission?Webservice is in the form of url and i already pass the specific user id.Please reply me..
This is the code,
Expand|Select|Wrap|Line Numbers
  1. public ActionResult AddPatientTreatment(string patientid, string treatmentid, string treatmentdate, string doctorname, string remarks, string doctorid, string paymentstatus, string paymentpaiddate,string ipid)
  2.         { 
  3.          string result = string.Empty, DateTimeFormat = string.Empty;
  4.             try
  5.             {
  6.                 _performtreatmentBAL.PatientId = Convert.ToInt32(patientid);
  7.                 _performtreatmentBAL.TreatmentId = Convert.ToInt32(treatmentid);
  8.                 if (treatmentdate != string.Empty)
  9.                 {
  10.                     DateTimeFormat = ClinicSettingsBLL.GetDateTimeFormate();
  11.                     _performtreatmentBAL.TreatmentDate = Common.ChangeFormat(DateTimeFormat, treatmentdate);
  12.                 }
  13.                 else
  14.                 {
  15.                     _performtreatmentBAL.TreatmentDate = DateTime.Now;
  16.                 }
  17.                 _performtreatmentBAL.Doctor = doctorname;
  18.                 _performtreatmentBAL.Remarks = remarks;
  19.                 _performtreatmentBAL.DoctorID = Convert.ToInt32(doctorid);
  20.                 _performtreatmentBAL.PaymentPaidStatus = false;
  21.                 _performtreatmentBAL.PaymentPaidDate = DateTime.Now;
  22.                 _performtreatmentBAL.IPId = ipid;
  23.                 result = Convert.ToString(AddPatientTreatments());
  24.  
  25.                 var data = new { status = 200, message = "{'AddPatientTreatmentResult' : [{'result':'" + result + "'}]}" };
  26.                 return Json(data, JsonRequestBehavior.AllowGet);
  27.                 //return GetXmlForResult("AddPatientTreatmentResult", result);
  28.  
  29.             }
  30.             catch (Exception ex)
  31.             {
  32.                 var data = new { status = 501, message =ex.Message };
  33.                 return Json(data, JsonRequestBehavior.AllowGet);
  34.                 //return GetXmlForResult("Error", ex.Message);
  35.             }
  36.  
  37.         }
  38.  
  39.   public int AddPatientTreatments()
  40.         {
  41.             try
  42.             {
  43.  
  44.  
  45.                 //ActivityLog.InsertActivity(Convert.ToString(DateTime.Now), "AddPatientTreatment()", "Use for insert patient treatment", "Doctor", "Before", System.Web.HttpContext.Current.Session["UserID"].ToString(), "", "");
  46.                 //********************************************************************************************************************************************************************************************************
  47.                 MySqlConnection conn = new MySqlConnection(ConnectionString());
  48.                 MySqlCommand cmd = new MySqlCommand("insertpatienttreatment", conn);
  49.                 cmd.CommandType = CommandType.StoredProcedure;
  50.                 cmd.Parameters.Add(new MySqlParameter("param1", _performtreatmentBAL.PatientId));
  51.                 cmd.Parameters.Add(new MySqlParameter("param2", _performtreatmentBAL.TreatmentId));
  52.                 cmd.Parameters.Add(new MySqlParameter("param3", string.Format("{0:s}", Convert.ToDateTime(_performtreatmentBAL.TreatmentDate))));
  53.                 cmd.Parameters.Add(new MySqlParameter("param4", _performtreatmentBAL.Doctor));
  54.                 cmd.Parameters.Add(new MySqlParameter("param5", _performtreatmentBAL.Remarks));
  55.                 cmd.Parameters.Add(new MySqlParameter("param6", _performtreatmentBAL.DoctorID));
  56.                 cmd.Parameters.Add(new MySqlParameter("param8", _performtreatmentBAL.PaymentPaidStatus));
  57.                 cmd.Parameters.Add(new MySqlParameter("param9", _performtreatmentBAL.PaymentPaidDate));
  58.                 cmd.Parameters.Add(new MySqlParameter("?param7", MySqlDbType.Int32));
  59.                 cmd.Parameters["?param7"].Direction = ParameterDirection.ReturnValue;
  60.                 cmd.Parameters.Add(new MySqlParameter("param10", _performtreatmentBAL.IPId));
  61.                 conn.Open();
  62.                 cmd.ExecuteNonQuery();
  63.                 object obj = new object();
  64.                 obj = (object)(cmd.Parameters["?param7"].Value);
  65.                 this._performtreatmentBAL.PatientTreatmentId = Convert.ToInt32(obj);
  66.                 cmd.Connection.Close();
  67.                 conn.Close();
  68.                 //********************************************************************************************************************************************************************************************************
  69.                 //ActivityLog.InsertActivity(Convert.ToString(DateTime.Now), "AddPatientTreatment()", "Use for insert patient treatment", "Doctor", "After", System.Web.HttpContext.Current.Session["UserID"].ToString(), "", "");
  70.                 return this._performtreatmentBAL.PatientTreatmentId;
  71.             }
  72.             catch (Exception e)
  73.             {
  74.                 //ActivityLog.InsertActivity(Convert.ToString(DateTime.Now), "AddPatientTreatment()", "Use for insert patient treatment", "Doctor", "Error", System.Web.HttpContext.Current.Session["UserID"].ToString(), "", e.Message.ToString());
  75.                 //********************************************************************************************************************************************************************************************************
  76.                 ErrorLogBAL.InsertException(e.Message, "InsertPatientTreatment");
  77.                 return 0;
  78.  
  79.             }
  80.         }
  81.  
Jan 17 '13 #1
4 1952
PsychoCoder
465 Expert Mod 256MB
Without seeing your code it's near impossible for us to offer any kind of assistance. When you post your code please format it with the <CODE/> button
Jan 17 '13 #2
Rabbit
12,516 Expert Mod 8TB
You need to tell us which function is throwing the error and which line of code is causing it. I'm not going to read through hundreds of lines of code to try to find it for you when you can just tell us.
Jan 17 '13 #3
Function AddPatientTreatments shows error.While debugging it run upto line 62.then it goes to exception"Function does not exist"
Jan 18 '13 #4
Rabbit
12,516 Expert Mod 8TB
I can't find a reference to a function named object().
Jan 18 '13 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Ari Royce Hidayat | last post by:
Dear ALL, Is there some one ever faces this problem? And fix it? The scenario is: There's an html page that hosts a .net object (using object tag), and this page opens the second html page...
0
by: Ari Royce Hidayat | last post by:
Tx a lot for idea. I've tried it, and still get not clue what causes it. I also tried to see the log file generated by IEHost (by adding IEHostLogFile to registry) and still get not clue what...
22
by: Ian | last post by:
The title says it all. I can see the case where a function is to be called directly from C, the name mangling will stuff this up. But I can't see a reason why a template function can't be...
13
by: baumann.Pan | last post by:
when define char *p = " can not modify"; p ='b' ;is not allowed, but if you declare p as char p = "can modify"; p = 'b'; is ok? why?
8
by: mdh | last post by:
May I ask this. Given the declaration: int myf( int, int); and a function pointer: (*fp)=int myf(int, int); where I am initializing fp to point at myf....or trying to..
3
by: kang jia | last post by:
hi, currently i am doing booking car online and one of the function is cancel and update booking. if the booking number users entered in is not exist. it will redirect the page stating that the...
30
by: kj | last post by:
My book (Flanagan's JavaScript: The Definitive Guide, 5th ed.) implies on page 111 that the following two constructs are equivalent: ( x.constructor == Foo ) and ( x instanceof Foo ) The...
2
by: =?Utf-8?B?U3dhcHB5?= | last post by:
hi, I am working on application in this i am using two files. In first (consider A) file i am calling the function of other file (consider B). In that function of file B i am calling the method...
22
by: MLH | last post by:
100 Dim db As Database, rst As Recordset 120 Set db = CurrentDb 140 PString = "SELECT qryBatchList.ReadyFor906, qryBatchList.BatchID FROM qryBatchList WHERE...
1
by: mikr | last post by:
I'm new to jquery, and hoping it will make my client side coding more friendly (particularly with regards to ie). As is usually the case, I've got some code that works nicely in ff, but kicks out...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.