Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi!

I create a database table following this video www.youtube.com/watch?v=3w2JkLcp-UA&feature=related

I want to add the cells and return the result in a textbox with a button!

Is this possible?

Help plz!!

Thnx!
Posted
Updated 22-Mar-12 16:23pm
v2
Comments
Sergey Alexandrovich Kryukov 22-Mar-12 22:42pm    
How can you imagine adding a cell to a table? :-)
--SA

Yes. It is possible. Need help with anything else?
 
Share this answer
 
Comments
lalaou 22-Mar-12 22:42pm    
Yes.need help to do it!!sry but i am totally beginner in C#!
[no name] 22-Mar-12 22:49pm    
Help to do what exactly? What code have you written to accomplish what you want to do? Do you even know what it is that you want to do? Do you get errors in your code? What have you search for?

I take it from the minimal information that you provided that you want to query information from your database and display the results in a textbox?

1 connect to the database.
2 query the information that you want to display.
3 textbox.text = whatever you want to display.

Databases of database tables do not have "cells" you can add. They have "record" or "rows" which you can add or remove. The notion of "cell" belong to the domain of UI controls. It can be an object of a grid, a (data) grid view, a list view (with) columns which (more or less loosely) used to represent database tables obtained as a result of queries.

[EDIT]

Basically, you need to use ADO.NET. For starters, I highly recommend this CodeProject article:
Using ADO.NET for beginners[^].

Another article on Insert/Update/Delete with ADO.NET:
Simple ADO.NET Database Read, Insert, Update and Delete using C#.[^].

I hope it will help you to get started.

—SA
 
Share this answer
 
v4
Comments
lalaou 22-Mar-12 22:51pm    
probably i wrote it wrong i want to know if i can add the content of a row and take the result in a textbox?
(the way i create the database is correct?)
Sergey Alexandrovich Kryukov 22-Mar-12 23:06pm    
No problem. Please see my updated answer, after [EDIT].
If it's getting to look sensible to you, please accept this answer formally (green button) -- thanks.
--SA
The video link given in your question shows each record of the database in a detail view. As I understand from your question you want to display all the records from database like in excel spreadsheet, and able to edit the data in individual cells. If this is the case then you can use DataGridView control for windows forms
An example is given here
http://www.dotnetperls.com/datagridview-tutorial[^]
http://www.youtube.com/watch?v=4VNE0OuLbgo[^]
http://www.youtube.com/watch?v=FYD3892SBQw[^]
Help regarding the DataGridView control can be found here
http://msdn.microsoft.com/en-us/library/k39d6s23.aspx[^]
 
Share this answer
 
Comments
lalaou 22-Mar-12 23:09pm    
Thanks!!!

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