I am getting an error "No overload for method 'add' takes '2' arguments" for the lines delete.add. Can someone please tell me what is the right way to use the delete.add ? Thanks in advance
PROJ_TABLE proj_Table = new PROJ_TABLE();
Delete delete = new Delete("PROJ_TABLE");
delete.add("CODE", proj_Table.CODE);
delete.add("NAME",proj_Table.NAME);
delete.add(Expression.eq("CODE", proj_Table_AG.CODE));
int ret = DB.execute(delete);
return ret;
Sorry! It came from a user defined class. I have been going through the codes and still cannot see why it would need 2 arguments based on my first post.. strange.
public class Delete
{
String from;
AndList where = new AndList();
public Delete(String table)
{
from = table;
}
public Delete add(Expression e)
{
if (e != null)
where.add(e);
return this;
}
public Delete add(OrList e)
{
if (e != null && e.count > 0)
where.add(e);
return this;
}
public Delete add(AndList e)
{
if (e != null && e.count > 0)
where.add(e);
return this;
}
public override string ToString()
{
StringBuilder str = new StringBuilder();
str.Append("DELETE FROM ").Append(from);
if (where.count > 0)
{
str.Append(" WHERE ");
str.Append(where);
}
return str.ToString();
}
}
vchany
Member
23 Points
32 Posts
Deleting a row from the database (Oracle.DataAccess)
Mar 22, 2012 02:58 AM|LINK
Hi all,
I am getting an error "No overload for method 'add' takes '2' arguments" for the lines delete.add. Can someone please tell me what is the right way to use the delete.add ? Thanks in advance
PROJ_TABLE proj_Table = new PROJ_TABLE(); Delete delete = new Delete("PROJ_TABLE"); delete.add("CODE", proj_Table.CODE); delete.add("NAME",proj_Table.NAME); delete.add(Expression.eq("CODE", proj_Table_AG.CODE)); int ret = DB.execute(delete); return ret;Mauro_net
Contributor
2114 Points
402 Posts
Re: Deleting a row from the database (Oracle.DataAccess)
Mar 22, 2012 05:15 AM|LINK
I might be a real jerk trying to help you on this matter but I've never seen before such sintaxis.
Are you using a framewok? like hibernate?
what do you see when you navigate to delete.add's definition ? (F12 over the "add" word)
where is detele() object defined?
vchany
Member
23 Points
32 Posts
Re: Deleting a row from the database (Oracle.DataAccess)
Mar 22, 2012 07:54 AM|LINK
Sorry! It came from a user defined class. I have been going through the codes and still cannot see why it would need 2 arguments based on my first post.. strange.
public class Delete { String from; AndList where = new AndList(); public Delete(String table) { from = table; } public Delete add(Expression e) { if (e != null) where.add(e); return this; } public Delete add(OrList e) { if (e != null && e.count > 0) where.add(e); return this; } public Delete add(AndList e) { if (e != null && e.count > 0) where.add(e); return this; } public override string ToString() { StringBuilder str = new StringBuilder(); str.Append("DELETE FROM ").Append(from); if (where.count > 0) { str.Append(" WHERE "); str.Append(where); } return str.ToString(); } }Mauro_net
Contributor
2114 Points
402 Posts
Re: Deleting a row from the database (Oracle.DataAccess)
Mar 22, 2012 02:41 PM|LINK
is your issue solved? how can i help you further?
MetalAsp.Net
All-Star
112219 Points
18266 Posts
Moderator
Re: Deleting a row from the database (Oracle.DataAccess)
Mar 22, 2012 03:00 PM|LINK