Part A
How do I link textboxes to individual database records when the database has say fifty rows and fifty columns.
The idea being to display and maintain a database with textboxes on a form that stand independent of each other that point to a specific spot in the database.
Part B
Once this is possible then ..
To be able to manage this data based on years meaning...
I would like to have this basic setup but I am able to have the database represent a set of data for a particular year and I would be able to choose to display data based on the year.
Please, if anyone knows .. respond asap..
Thanks
Shihan

could not update the database
ttad
Hi,
when i come across this page ,i am also in need of similar sort of thing. I just want to display the values present in textboxes directly to gridview.
Do help me. I'm Dying.
LivePentium
well how are you binding the textboxes To update, either generate your own Update statement and execute that, or if you are using a DataAdapter to fill a dataset, which you are binding to the textboxes, then you can call the DataAdapter's Update() method, giving it the dataset so it commits changes to the database correctly. I think you may need to change the textbox's DefaultDataSourceUpdateMode to DataSourceUpdateMode.OnPropertyChanged so when you change the text in the textbox it will then update the datasource (dataset)
Here is an example if using a dataAdapter to fill a dataset and bind records:
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=753872&SiteID=1
Executing a manual update statement:
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=728535&SiteID=1
A1Programmer
well the codes written are just snippets which you can modify to your needs, experiment :-)
the second one is on how to create an Update statement manually so you can update records to the database giving it values, the first one is indeed binding to a datagrid - which you can modify to bind to the textbox for example. The code pretty much does apply with some modifications
Try experimenting with them and see if you can understand how its working
kunal.pandya
ok please,
how do I get to update the database with these direct linked textboxes. how do i code the box to display and update the database.
The textboxes do display the data but do not update the database.
Please reply
Shihan
Eric Liprandi
Another one of my posts has been deleted. Oink.
vsphp
A solution i found... in the database use float instead of integer or money.
Shihan
Jessica Alba
well, you can set a databinding on the textbox.
Me.theTextBox.DataBindings.Add("Text", DataSet.Tables(0), "FieldName")
this will bind the text property of the textbox to the field name of the dataset given.
partB)
if you have a dataset, you can query it using a DataView, meaning you can filter your records and get the results you want and databind them to say, a datagridview or something. Example:
Dim theDataView as new DataView(theDataSet.Tables(0))
theDataView.RowFilter = "[FieldName] = yearValue"
Me.theDataGridView.DataSource = theDataView
does this help is this what you are after
PsyCadelik
Ahmedilyas... help
I cant get the database to display its value without truncating the last two digits OR now it shows four decimals. How do I control this four decimal displaying in the textbox.
Shihan
R2 DJ
hi
This manavallan
I am using Visual Studio Express Edition.In this I am doing a small project in Visual Basic.I am new to this Visual Studio.I am facing a problem.When i am trying to Add or Save a record in the database it is not updating in the database.I am using mdb tables to store the records.It also giving some errors like problem in String conversion.Could you please help me in this.If possible can u send me some Source coding for Declaring variables,Adding,Saving records etc,because i am new to this Visual Studio. Wating for your reply
with regards
manavallan.
Crukis
Forgive me but i am not sure of the code to use.
The first seemed to be for GridView and the second I did not understand how to apply.
Shihan
PS. Thanks for your time ... I can tell u r helping many
hits krishna
ok i have a strange problem.
I individually bind the textboxes to the database, set the database to money but when the textbox displays the number.. say 1744.44 from the database, the number is truncated to 1744.00. How can i fix this.
Shihan
Midnight Conjurer
I will be more specific..
I have twelve months for the year (Rows), and fifty lines each representing a source (creditor).
Each textbox is a bill value.
The textboxes must be able to change values in the database as well as display current values.
The fifty boxes represent a year so there has to be ability to continue to new years and information.
the problem is to get the textboxes to point to the database and represent a value placed there.
also to be able to have the year represent the relative data.
Thanks