Click here to Skip to main content
16,004,974 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Pagesetup & PrintPreview Pin
nishkarsh_k20-Nov-07 17:50
nishkarsh_k20-Nov-07 17:50 
GeneralRe: Pagesetup & PrintPreview Pin
MrFulvio20-Nov-07 20:37
MrFulvio20-Nov-07 20:37 
QuestionFile copy in vb6 Pin
w20919-Nov-07 22:25
w20919-Nov-07 22:25 
AnswerRe: File copy in vb6 Pin
Alex Feature19-Nov-07 22:44
Alex Feature19-Nov-07 22:44 
GeneralRe: File copy in vb6 Pin
w20919-Nov-07 23:21
w20919-Nov-07 23:21 
GeneralRe: File copy in vb6 Pin
ChandraRam21-Nov-07 0:54
ChandraRam21-Nov-07 0:54 
QuestionUpdate database from Datagrid Pin
matjame19-Nov-07 20:09
matjame19-Nov-07 20:09 
AnswerRe: Update database from Datagrid Pin
Alex Feature19-Nov-07 21:27
Alex Feature19-Nov-07 21:27 
This is just a comment Wink | ;) cause a don’t really like doing db stuff in code.

You might wana review your approach to this problem. Placing the connection code inside the row update event is not the best idea.

You should consider using datasets, table adapters etc. to simplify this process.

For example:

1. Form init

2. grid loaded by querying a table adapter in the dataset

3. returned result is passed to .Datasource of the grid

4. grid is refreshed

5a. row changes on the grid are auto reflected on underlying data in the dataset table (not db)

5b. row changes remain in memory

6. once you actually need to write the whole thing to the db use the table adapter's .Update method on the dataset

7. dispose of the form or whatever


Obvious benefits:

1. overhead of connecting to the db every time a row is changed is eliminated
2. simpler implementation allows for greater control and easier maintenance
3. dataset classes can be extended to handle everything themselves with minimal interference



If you have dataset specific questions post them here, members will definitely help you out


"All your base are belong to us..."

Mr. Cats (2110 A.D.)

GeneralRe: Update database from Datagrid Pin
matjame19-Nov-07 21:30
matjame19-Nov-07 21:30 
GeneralRe: Update database from Datagrid Pin
Vimalsoft(Pty) Ltd21-Nov-07 19:14
professionalVimalsoft(Pty) Ltd21-Nov-07 19:14 
Questionsaving into xml Pin
for120619-Nov-07 19:50
for120619-Nov-07 19:50 
AnswerRe: saving into xml Pin
Dave Kreskowiak21-Nov-07 4:58
mveDave Kreskowiak21-Nov-07 4:58 
QuestionInputbox () in Vb.net Pin
VB 8.019-Nov-07 19:30
VB 8.019-Nov-07 19:30 
AnswerRe: Inputbox () in Vb.net Pin
Johan Hakkesteegt20-Nov-07 2:21
Johan Hakkesteegt20-Nov-07 2:21 
GeneralRe: Inputbox () in Vb.net Pin
for120620-Nov-07 18:23
for120620-Nov-07 18:23 
GeneralRe: Inputbox () in Vb.net Pin
Johan Hakkesteegt20-Nov-07 20:05
Johan Hakkesteegt20-Nov-07 20:05 
QuestionSystem.InvalidOperationException: Update unable to find TableMapping['Table'] or DataTable 'Table'. Pin
Piyush Vardhan Singh19-Nov-07 19:00
Piyush Vardhan Singh19-Nov-07 19:00 
AnswerRe: System.InvalidOperationException: Update unable to find TableMapping['Table'] or DataTable 'Table'. Pin
Dave Kreskowiak20-Nov-07 6:30
mveDave Kreskowiak20-Nov-07 6:30 
Question[Message Deleted] Pin
~V~19-Nov-07 18:25
~V~19-Nov-07 18:25 
AnswerRe: Need Your Guidance Pin
Vasudevan Deepak Kumar19-Nov-07 18:33
Vasudevan Deepak Kumar19-Nov-07 18:33 
AnswerRe: Need Your Guidance Pin
deathbat20-Nov-07 12:48
deathbat20-Nov-07 12:48 
AnswerRe: Need Your Guidance Pin
Christian Graus19-Nov-07 18:34
protectorChristian Graus19-Nov-07 18:34 
AnswerRe: Need Your Guidance Pin
DaveX8619-Nov-07 18:35
DaveX8619-Nov-07 18:35 
AnswerRe: Need Your Guidance Pin
~V~19-Nov-07 18:48
~V~19-Nov-07 18:48 
AnswerRe: Need Your Guidance Pin
Alex Feature19-Nov-07 21:56
Alex Feature19-Nov-07 21:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.