I have bug in deleting from db, update ,insert works fine

  • Thread starter Montezuma's Daughter
  • Start date
M

Montezuma's Daughter

I have a small project in c# and ms-access
I use query builder to manage my tables in ms-access.
the problem is, select qeury works great, update query works great,
delete doesn't work , and there is no error msg!!!!!!1 please help!!



OleDbDataAdapter adapter = new OleDbDataAdapter();
string queryString = "SELECT [Id],[Name] FROM
[myTable]";
cn.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + _conStrName + ";User
Id=admin;Password=;";
OleDbConnection connection = new OleDbConnection
(cn.ConnectionString);
adapter.SelectCommand = new OleDbCommand
(queryString, connection);
adapter.SelectCommand.CommandText = queryString;

OleDbCommandBuilder builder = new
OleDbCommandBuilder(adapter);
adapter.Update(ds.Tables["myTable"]);

return ds;*
 
J

Joe Cool

I have a small project in c# and ms-access
 I use query builder to manage my tables in ms-access.
the problem is, select qeury works great, update query works great,
delete doesn't work , and there is no error msg!!!!!!1 please help!!

                    OleDbDataAdapter adapter = new OleDbDataAdapter();
                    string queryString = "SELECT [Id],[Name] FROM
[myTable]";
                    cn.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + _conStrName + ";User
Id=admin;Password=;";
                    OleDbConnection connection = new OleDbConnection
(cn.ConnectionString);
                    adapter.SelectCommand = new OleDbCommand
(queryString, connection);
                    adapter.SelectCommand.CommandText= queryString;

                    OleDbCommandBuilder builder = new
OleDbCommandBuilder(adapter);
                     adapter.Update(ds.Tables["myTable"]);

                    return ds;*

You need to include the code that builds the delete query.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top