Click here to Skip to main content
15,893,668 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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.
Posted
Updated 23-Jun-15 4:26am
v2
Comments
Nathan Minier 23-Jun-15 9:29am    
Is there a compelling reason that you cannot use a solution that already exists?

Such as phpMyAdmin: http://www.phpmyadmin.net/home_page/index.php
Lakhan Anjana 23-Jun-15 9:31am    
Google FOR CRUD operation using C# :)
F-ES Sitecore 23-Jun-15 9:32am    
First give your tables meaningful names, not things like "tbl1" etc. Second google "asp.net entity framework crud" and you'll find examples of how to manage tables using Entity Framework which will probably be the easiest way forward.
[no name] 23-Jun-15 10:49am    
"Guide" to do what exactly? What code have you written? What is the problem with the code that you have written?
Member 11785935 24-Jun-15 2:39am    
Hi Wes, I have a table (let's say with some kind of events) in this table besides the specific fields of the event I have few id's from other tables (let's say for username, location, persons, etc - each with their own table). So, I need some "guides" to obtain a method through which in a windows form select from two or more tables from a (let's say combobox) list of description and write in this event table the id's for each selected description (location, person, and so on). And of course, after that, when you try to modify this table to see the right description instead of the id's.
On the other hand, about the already existing code, in this moment I made an application in c# from vs2010 based on the very professional "drag-n-drop" method :)) - works very fine with the "descriptions" not "id's" described above.
Thanks for comment.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900