PostgreSQL和dataGridView C# [英] PostgreSQL and dataGridView C#
问题描述
我将C#客户端连接到PostgreSQL数据库时遇到问题.我使用NPGSQL适配器成功建立了连接,但是后来我不知道该怎么办...我设法通过代码将更改应用于数据库...但是...
主要问题是:
如何使用dataGridView实时/通过按钮将更改从C#客户端应用于Postgresql数据库...
我已经创建了数据集,使其从datagridview读取更改,但是要通过datagridview应用更改(简单地说-您在客户端填写表格,然后通过单击按钮或事件将其保存到数据库)?
我已经搜索了整整一周的答案,却找不到不在Google或其他任何地方的信息...
我感谢任何建议/帮助/代码,谢谢.
I`ve problem with connecting my C# client to PostgreSQL database. I use NPGSQL adapter to successfully establish a connection but then i`ve no idea what to do... I managed to apply change to a database via code... but...
The main question is:
How to apply changes from C# client to Postgresql database using dataGridView live/via button click...
I`ve created dataset, made it read changes from datagridview, but to apply changes via datagridview (simply put - you fill your table on client side and then via button click or event it is saved to database)?
I`ve searched for entire week for answer and can`t find any info not on google or anywhere else...
I appreciate any advice/assistance/code, thank you.
推荐答案
我去年做过类似的事情,但仍然有我的"database.cs"类,我上传到我的保管箱,看看..希望对您有所帮助!
http://dl.dropbox.com/u/5986982/Database.cs [ ^ ]
问候,
Felipe
I have done something similar to this last year and I still have my "database.cs" class, I uploaded on my dropbox, take a look.. I hope it helps!
http://dl.dropbox.com/u/5986982/Database.cs[^]
Regards,
Felipe
实际上,我昨天已经写了一个教程,如果您仍然有此想法,请看一下:)
http://codeabout .wordpress.com/2012/03/08/working-with-postgres-database-and-c-by-using-npgsql-and-reflection/ [
In fact, I have written a tutorial yesterday, if you still have that in mind, take a look please :)
http://codeabout.wordpress.com/2012/03/08/working-with-postgres-database-and-c-by-using-npgsql-and-reflection/[^]
这篇关于PostgreSQL和dataGridView C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!