开发者

delete records in foxpro 2.x using oledb connection

开发者 https://www.devze.com 2023-01-27 17:46 出处:网络
hi there first of all im completed excited to use for first time this incredible forum my question is, if somebody knows how to physically delete a Fox pro 2.x record from C#.net using an OleDb conn

hi there first of all im completed excited to use for first time this incredible forum

my question is, if somebody knows how to physically delete a Fox pro 2.x record from C#.net using an OleDb connection, because i used a simple and standard delete sql state开发者_如何学编程ment like 'delete from table where condition' and the compiler throws me an exception that i have a sintax error.

p.s. im mexican so please be considered about my english, im not pretty good at all.


Could you show the code you used? As the simple delete from table where condition should indeed work just fine.

Did you use a DBCommand with .ExecuteNonQuery() ?

In general the pattern is basically this...

    IDbConnection c = GetYourConnectionOrNewOneUp();
    using (IDbCommand cmd = c.CreateCommand())
    {
      cmd.CommandText = "delete from yourtable where yourfield = 'value'";
      cmd.ExecuteNonQuery();
    } 
0

精彩评论

暂无评论...
验证码 换一张
取 消