查询,写作&在C#中从MySQL数据库中删除 [英] Query, write & delete from a MySQL database in C#

查看:172
本文介绍了查询,写作&在C#中从MySQL数据库中删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将我的连接设置为本地MySQL数据库,并且我首先尝试查询数据,但我看到的每个示例都以不同的方式进行。


我需要做的是查询数据库以从满足某些条件(在两个值之间)的表中读出某些数据范围。然后需要将这些条目写入数组以供我根据需要进行操作。


下一部分是将一些被操纵的数据写回另一个表中。这只会将它附加到表的末尾。


最后,我需要删除符合特定条件的表中的条目,即帖子较旧比某个时间戳更好。


任何帮助都会很棒!


谢谢,Dan。


PS我已经从C#编码中休息了很长时间,并且已经为这个项目重新选择了它,所以不要假设我知道的事情:)

解决方案

您好DPashley,


感谢您发布此处。


对于您的问题,请从代码项目下载源文件。在本文中,它演示了如何将C#连接到MySQL并使用insert,update,delete和select语句的简单示例查询表。


https://www.codeproject .com / Articles / 43438 / Connect-C-to-MySQL


最好的问候,


Wendy


I have my connection set up to the local MySQL database and am first trying to query out data, but every example I look at does it in a different way.

What I need to do is query the database to read out certain ranges of data from a table that meet some conditions (that are between two values). These entries then needs to be written to an array for me to manipulate as I need to.

The next part is to write some of the manipulated data back into another table. This will just append it to the end of the table.

Finally, I need to delete entries from tables that meet certain criteria, i.e. a post is older than a certain timestamp.

Any help would be great!

Thanks, Dan.

P.S. I have taken a long break from C# coding and have just picked it up again for this project, so don't assume I know things :)

解决方案

Hi DPashley,

Thank you for posting here.

For your question, please download the source file from the code project. In this article, it demonstrated how to connect C# to MySQL and query the tables using simple examples for the insert, update, delete and select statements.

https://www.codeproject.com/Articles/43438/Connect-C-to-MySQL

Best Regards,

Wendy


这篇关于查询,写作&在C#中从MySQL数据库中删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆