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.....

Recommended Answers

All 2 Replies

is "id" a numeric field?

is "id" a numeric field?

Ofcousre it is....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.