I just cannot seem to find any straight-forward explanations about anything in .NET. Everything
is part of some particular task being solved.
“Let’s say we want to set up a used car dealership . . . ” Great. I learn how to solve the suggested problem, but it is like searching for a needle in a haystack to find the behavior of the control in a category not covered in the problem being solved.
When you edit info in rows of a DataGridView (DGV), are all changes to all rows held until you use some update method, or do saves have to be undertaken anytime you move to a new row after editing?
When adding rows, are all additions stored until the datasource is updated, or do you have to perform an update for each row, 1 at a time?
Is there an event that fires when an update needs to be done to avoid losing data?
Is there a property that indicates the data are dirty?
I am using the following, which I found in VS ’05 Help. It properly fills in my DGV:
Private dtAdptr As New OracleDataAdapter()
Private BndgSrc As New BindingSource()
Private Sub FormLoad(ByVal sender As Object, _
ByVal e As System.EventArgs) _
' Me.DataGrid is the control on the form.
Me.DataGrid.DataSource = Me.BndgSrc
Me.dtAdptr = New OracleDataAdapter("<valid SQL>", _
"<valid Connection String>")
Dim CmdBldr As New OracleCommandBuilder(Me.dtAdptr)
' The statement above is what was suggested in Help,
' but CmdBldr is never used. Is this intended as a
' statement that modifies the DataAdapter?
Dim dt As New DataTable()
Me.BndgSrc.DataSource = dt
When it is time to update the data, what are the necessary steps?
I need to not use VS tools to set this up. The form is generic, and is loaded with data dynamically. the form does not specifiy the data source until it is manipulated prior to being shown.
So instructions on how to drag this—N—that from the tool box onto the form and fill it in with a wizard will be less than helpful.
Any suggestions on a book or on books that describe the performance of controls outside a proposed task? I am looking for something like a cookbook, aor a BlackBook. You look up the control, and the control is defined, along with the steps that need to be taken to make it operate.
For instance, with the DGV, a description of the various ways to fill it with data (with a brief sample of each), a description of how to save edits (with a breif sample of each), and so on, presented in a way that doesn't require reading back 5 chapters to follow the development of the "scenario."