From: Peter Brawley Date: November 18 2005 6:17pm Subject: Re: "Function Does Not Exist" List-Archive: http://lists.mysql.com/mysql/191849 Message-Id: <437E1ACA.4060203@earthlink.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=======AVGMAIL-437E1ACC1110=======" --=======AVGMAIL-437E1ACC1110======= Content-Type: multipart/alternative; boundary=------------070602080009010904070400 --------------070602080009010904070400 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Jesse, />I'm using the following code in my ASP.NET application to add a new record >to the database, and return the added ID:/ You may have persuaded dotNet that your sproc returns something, ie that it is a function, but you apparently created it as a procedure. An sproc returns nothing. PB ----- Jesse Castleberry wrote: >I'm using the following code in my ASP.NET application to add a new record >to the database, and return the added ID: > > Cmd=New MySqlCommand("sp_InsertNewCamper",Conn) > Cmd.CommandType = CommandType.StoredProcedure > paramReqID = Cmd.Parameters.Add("return",SqlDbType.Int) > paramReqID.Direction = ParameterDirection.ReturnValue > Cmd.Parameters.Add("FirstName",FirstName.Text) > Cmd.Parameters.Add("LastName",LastName.Text) > Cmd.Parameters.Add("UserName",UserName.Text) > Cmd.Parameters.Add("Password",Password.Text) > > Cmd.ExecuteNonQuery() > cID = CStr(Cmd.Parameters("return").Value) > >When I execute this code, I get the error, "#42000FUNCTION >fccamp.sp_InsertNewCamper does not exist". However, it DOES exist. I can >see it. It's named exactly the same, there are no misspellings or anything. >One other difference is that this is calling it a "function" where it is >actually a procedure. I could make this a function, I guess, however, I >don't know how to write the code in ASP.NET to grab the return value. > >I've checked Google, and found very little on this error, and don't even >know what to look for in the manual. Does anyone know what might be going on >here? > >Thanks, >Jesse > > > > --------------070602080009010904070400 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
Jesse,
I'm using the following code in my ASP.NET application to add a new record
to the database, and return the added ID:
Cmd=New MySqlCommand("sp_InsertNewCamper",Conn)
Cmd.CommandType = CommandType.StoredProcedure
paramReqID = Cmd.Parameters.Add("return",SqlDbType.Int)
paramReqID.Direction = ParameterDirection.ReturnValue
Cmd.Parameters.Add("FirstName",FirstName.Text)
Cmd.Parameters.Add("LastName",LastName.Text)
Cmd.Parameters.Add("UserName",UserName.Text)
Cmd.Parameters.Add("Password",Password.Text)
Cmd.ExecuteNonQuery()
cID = CStr(Cmd.Parameters("return").Value)
When I execute this code, I get the error, "#42000FUNCTION
fccamp.sp_InsertNewCamper does not exist". However, it DOES exist. I can
see it. It's named exactly the same, there are no misspellings or anything.
One other difference is that this is calling it a "function" where it is
actually a procedure. I could make this a function, I guess, however, I
don't know how to write the code in ASP.NET to grab the return value.
I've checked Google, and found very little on this error, and don't even
know what to look for in the manual. Does anyone know what might be going on
here?
Thanks,
Jesse
--------------070602080009010904070400--
--=======AVGMAIL-437E1ACC1110=======
Content-Type: text/plain; x-avg=cert; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Content-Description: "AVG certification"
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.4/175 - Release Date: 11/18/2005
--=======AVGMAIL-437E1ACC1110=======--