Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6649993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:50:26+00:00 2026-05-26T00:50:26+00:00

i am using mysql with .net framework 4.0 . i have stored procedures in

  • 0

i am using mysql with .net framework 4.0 . i have stored procedures in my database. my stored procedure calling is:

public DataTable addProductMenu(int myid, string itemname)
    { 
        MySqlConnection connection = new MySqlConnection(connectionString);
        MySqlDataAdapter adapt = new MySqlDataAdapter("updateProductMenu", connection);
        adapt.SelectCommand.CommandType = CommandType.StoredProcedure;
        adapt.SelectCommand.Parameters.AddWithValue("myid", myid);
        adapt.SelectCommand.Parameters.AddWithValue("itemname", itemname);

        DataTable dt = new DataTable();
        adapt.Fill(dt);
        adapt = null;
        if (dt != null && dt.Rows.Count != 0)
        {
            return dt;
        }
        else
        {
            return null;
        }

    }

code is working when i use insert, select commands in database but not update. i tested my procedure in mysql query browser and its working fine.

Also tried this code for just update query

public DataTable updateProductMenu(int myid, string itemname)
    { //Veritabanından ürün menüsündeki başlığı güncelle

        MySqlConnection cnx = new MySqlConnection(connectionString);
        MySqlDataAdapter adapter = new MySqlDataAdapter();

        string cmdText = "updateProductMenu";
        MySqlCommand cmd = new MySqlCommand(cmdText, cnx);

        cmd.CommandType = CommandType.StoredProcedure;
        MySqlParameter param;
        param = new MySqlParameter("?myid", MySqlDbType.Int32);
        param.Value = myid;
        param.Direction = ParameterDirection.Input;
        cmd.Parameters.Add(param);

        param = new MySqlParameter("?itemname", MySqlDbType.VarChar);
        param.Value = itemname;
        param.Direction = ParameterDirection.Input;
        cmd.Parameters.Add(param);

        adapter.SelectCommand = cmd;

        DataTable dt = new DataTable();
        adapter.Fill(dt);
        adapter = null;
        if (dt != null && dt.Rows.Count != 0)
        {
            return dt;
        }
        else
        {
            return null;
        }
}

both have the error

Procedure or function '`updateProductMenu`' cannot be found in database '`mydatabase`'.

ADDED—————————————–

the user has all privileges. i checked again.

here is my connectionstring in web.config file…:

<add name="maktesConn" connectionString="Server = myserver; Port =3306; Database =mydatabase; Uid =mysqlsanatkar; Pwd =*123qsanatq*/;" />

…….and here is part of my class…..:

public class Mimages
{
    private string connectionString;

    public Mimages()
    {
    connectionString = ConfigurationManager.ConnectionStrings["maktesConn"].ToString();
    }

and here is part of my stored procedure

DROP PROCEDURE IF EXISTS mydatabase.updateProductMenu $$
CREATE PROCEDURE mydatabase.updateProductMenu (myid INT, itemname VARCHAR(60))
BEGIN
....
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:50:26+00:00Added an answer on May 26, 2026 at 12:50 am

    Solved the problem…. mysql connector for .net was 6.3.7. i updated it to 6.4.4. Now all my stored procedures are working. Thanks for your reply “bang” btw.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using ASP.NET C# with mySql database. What is the best way for
I am using NHibernate/Fluent NHibernate in an ASP.NET MVC app with a MySQL database.
I am using ASP.NET MVC2 on top of a MySQL database in VS2008. I
I'm using Entity Framework to access my MySQL database. The model was generated using
I am trying use MySql and Entity Framework, using Connector/Net 6.1 with this as
I am using MySQL database to work in ASP.NET MVC 3, i've already set
Has anyone here used MySQL with the entity framework 4.0 and stored procedures? When
Ok I've seen this question Entity Framework: Generate Database From Model removes Stored Procedures
I am using Mysql .Net Connector to access a database in C#. I get
I have a WPF application in which I use entity framework with mysql connector/net

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.