如何使用C#管理小型MS SQL数据库 [英] How do I using C# to manage a small MS SQL database

查看:204
本文介绍了如何使用C#管理小型MS SQL数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我是IT中的非常新手,但我试着学习:)。

这是我的问题:

1.我有一个MS SQL数据库,其表格如下:tbl1(id_tbl1,description_tbl1,其他字段),tbl2(id_tbl2,description_tbl2,其他字段)等等......

和像这样的表:mixtbl1(id_tbl1,id_tbl5,其他字段)等...

2.我想编写一个可视化的C#解决方案来管理这种数据库,但我不知道如何实现下一个想法:

- 对于mixtbl1我想在列表中显示description_tbl1,description_tbl5等等(比如组合框),但要保存id_tbl1,id_tbl5等等;

- 当然,当我编辑已保存的记录时,描述字段必须包含正确的值。



所以,任何人都可以指导我怎么做?



很多,很多,提前谢谢,

Ionut



PS。非常感谢Nathan Minier,Lakhan Anjana和F-ES Sitecore的快速回复。

不幸的是我已经阅读了很多CRUD示例但是,正如我在第一篇文章中所看到的那样,简单的使用个别表对我来说不是问题,此时我的问题在于上述相关性。

再次感谢。

Hello everyone,
I'm "very" newbie in IT, but I try to learn :).
Here is my problem:
1. I have a MS SQL database with tables like this: tbl1 (id_tbl1, description_tbl1, other fields), tbl2 (id_tbl2, description_tbl2, other fields) and so on...
and tables like this: mixtbl1(id_tbl1, id_tbl5, other fields) and so on...
2. I want to write a visual C# solution to manage this kind of database but I don't know how to implement the next idea:
--for the mixtbl1 I want to show the description_tbl1, description_tbl5, and so on in a list (like combobox) but to save the id_tbl1, id_tbl5, and so on;
--of course when I edit an already saved record the descriptions field must contain the right values.

So, can anyone guide me how to do that?

Many, many thanks in advance,
Ionut

PS. Many thanks to Nathan Minier, Lakhan Anjana and F-ES Sitecore for their fast reply.
Unfortunately I already read many CRUD examples but, as one can see from what I wrote in the first, simple using of individual table is not a problem for me in this moment my problem consist in the correlation described above.
Thanks again.

推荐答案

查找一些示例示例。这可以通过ADO.NET轻松完成。

1. http://dotnetdaily.net/tutorials/ado-net-tutorial-create-update-delete-operations/ [ ^ ]



2. ADO.NET,正确的方式 [ ^ ]



3. http://srikanthtechnologies.com/blog/dotnet/adonetcrud1.aspx [ ^ ]
Find some sample examples here. This can be easily done with ADO.NET.
1. http://dotnetdaily.net/tutorials/ado-net-tutorial-create-update-delete-operations/[^]

2. ADO.NET, the right way[^]

3. http://srikanthtechnologies.com/blog/dotnet/adonetcrud1.aspx[^]


这篇关于如何使用C#管理小型MS SQL数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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