0

I hav created a database using a windows application form in vc++
i can add and delete entries in the database..
but my prob is that the database s nt getting updated....
it says that "no value given for one or more required parameters"

my update code s as follows

private void BtnUpdate_Click(object sender, EventArgs e)
        {
            MAcmd.CommandText = "UPDATE table1 "+
                                "SET info ='"+TxtBoxUpdate_NewVal.Text+"' "+
                                "WHERE id = "+TxtBoxUpdate_WhereVal.Text;
            try
            {
                int row_affected = MAcmd.ExecuteNonQuery();
                MessageBox.Show(row_affected.ToString() + " row affected.", "Update command result");
            }
            catch (Exception ex)                 
            {
                MessageBox.Show(ex.Message);
            }
        }

i hav given values for both SET INFO (ie TxtBoxUpdate_WhereVal.Text) and WHERE ID (ie TxtBoxUpdate_NewVal.Text)

But i am helpless.... My database s nt updated...

somebody help me... plz.....

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by Subathiran
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.