Last post Nov 30, 2009 01:31 PM by hans_v
None
0 Points
27 Posts
Nov 30, 2009 11:11 AM|urania|LINK
Hi all
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!!!!!!
please help!!
Contributor
7452 Points
2340 Posts
Nov 30, 2009 12:13 PM|integrasol|LINK
Can you show us the code, please?
Nov 30, 2009 12:34 PM|urania|LINK
using (cn)
{
OleDbDataAdapter adapter = new OleDbDataAdapter();
string queryString = "SELECT [a],[b] FROM [table]";
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);
OleDbCommandBuilder builder = new OleDbCommandBuilder(adapter);
adapter.SelectCommand.CommandText = queryString;
adapter.DeleteCommand = builder.GetDeleteCommand();
adapter.Update(DATATABLE);
return ds;
Nov 30, 2009 12:41 PM|integrasol|LINK
Right, I don't see how and where you try to delete a row? The code looks somewhat incomplete, did you mix two blocks of code, or...?
Nov 30, 2009 12:56 PM|urania|LINK
in query builder, I don't need to write the sql code . update works nd so as insert. any idea how to help me?
All-Star
25756 Points
7014 Posts
Nov 30, 2009 01:31 PM|hans_v|LINK
urania in query builder, I don't need to write the sql code . update works nd so as insert. any idea how to help me?
Read this
None
0 Points
27 Posts
command builder problem IN delete- please help!!
Nov 30, 2009 11:11 AM|urania|LINK
Hi all
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!!!!!!
please help!!
Contributor
7452 Points
2340 Posts
Re: command builder problem IN delete- please help!!
Nov 30, 2009 12:13 PM|integrasol|LINK
Can you show us the code, please?
Carsten
Please click Mark as Answer if this post is of help to you. :-)
My Blog
None
0 Points
27 Posts
Re: command builder problem IN delete- please help!!
Nov 30, 2009 12:34 PM|urania|LINK
using (cn)
{
OleDbDataAdapter adapter = new OleDbDataAdapter();
string queryString = "SELECT [a],[b] FROM [table]";
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);
OleDbCommandBuilder builder = new OleDbCommandBuilder(adapter);
adapter.SelectCommand.CommandText = queryString;
adapter.DeleteCommand = builder.GetDeleteCommand();
adapter.Update(DATATABLE);
return ds;
Contributor
7452 Points
2340 Posts
Re: command builder problem IN delete- please help!!
Nov 30, 2009 12:41 PM|integrasol|LINK
Right, I don't see how and where you try to delete a row? The code looks somewhat incomplete, did you mix two blocks of code, or...?
Carsten
Please click Mark as Answer if this post is of help to you. :-)
My Blog
None
0 Points
27 Posts
Re: command builder problem IN delete- please help!!
Nov 30, 2009 12:56 PM|urania|LINK
in query builder, I don't need to write the sql code . update works nd so as insert. any idea how to help me?
All-Star
25756 Points
7014 Posts
Re: command builder problem IN delete- please help!!
Nov 30, 2009 01:31 PM|hans_v|LINK
Read this