Click here to Skip to main content
16,006,594 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: differnce betwen Me.Close() and Me.Dispose() PinPopular
Daniel Grunwald23-Oct-08 23:05
Daniel Grunwald23-Oct-08 23:05 
QuestionHow to Serializable OracleConnection Pin
lucdt23-Oct-08 18:07
lucdt23-Oct-08 18:07 
AnswerRe: How to Serializable OracleConnection Pin
Dave Kreskowiak24-Oct-08 1:35
mveDave Kreskowiak24-Oct-08 1:35 
GeneralRe: How to Serializable OracleConnection Pin
lucdt24-Oct-08 17:38
lucdt24-Oct-08 17:38 
AnswerRe: How to Serializable OracleConnection Pin
Wendelius24-Oct-08 7:59
mentorWendelius24-Oct-08 7:59 
GeneralRe: How to Serializable OracleConnection Pin
Anh trang24-Oct-08 17:29
Anh trang24-Oct-08 17:29 
Questionupdating database through datagrid - HELP PLEASE! Pin
libbypop23-Oct-08 17:44
libbypop23-Oct-08 17:44 
AnswerRe: updating database through datagrid - HELP PLEASE! Pin
Johan Hakkesteegt24-Oct-08 0:41
Johan Hakkesteegt24-Oct-08 0:41 
Where to begin...

First you appear to be mixing up two completely different approaches to updating a database.

Second, you are using a dataset object, which contains ready methods for select, insert and update, and then you try to create the update statement by hand, run it through a OleDbCommand, which you then not connect to the data adapter, which you then expect to execute the OleDbCommand, by calling its fill method, which executes the select statement.

Third, you check whether your dataset has changes and then, when it does, you empty it by assigning it to a new empty dataset.

Fourth, etc, etc, etc.

So, not to leave you hanging, try to go through the following steps and rewrite your code:
1. when you created the OleDataAdapter, you supposedly wrote some select statement.
2. when you finished creating the OleDataAdapter the designer should have created the necessary update and insert statements for you.
3. you created a dataset and bound it to the OleDataAdapter.
4. you probably have a button or something that will execute OleDataAdapter1.Fill(DataSet1, "TableName"). This executes the select statement
5. your datagrid shows the contents of the dataset because you bound it to the dataset.
6. the user makes changes in the datagrid. The dataset bound to the datagrid records the changes (automatically).
7. you probably have a button or something that will execute the code you posted.
8. Completely forget your code. Writing entirely new code will be easier than correcting this mess.
9. use
OleDataAdapter1.Update(DataSet1)
instead.

Good luck,

Johan

My advice is free, and you may get what you paid for.

QuestionData validation in a textbox Pin
saypokguy23-Oct-08 14:03
saypokguy23-Oct-08 14:03 
AnswerRe: Data validation in a textbox Pin
Rupesh Kumar Swami23-Oct-08 20:50
Rupesh Kumar Swami23-Oct-08 20:50 
AnswerRe: Data validation in a textbox Pin
Wendelius24-Oct-08 8:20
mentorWendelius24-Oct-08 8:20 
Questiontextbox Pin
kewyn23-Oct-08 8:58
kewyn23-Oct-08 8:58 
AnswerRe: textbox Pin
Dave Kreskowiak23-Oct-08 9:06
mveDave Kreskowiak23-Oct-08 9:06 
GeneralRe: textbox Pin
kewyn23-Oct-08 9:19
kewyn23-Oct-08 9:19 
GeneralRe: textbox Pin
Dave Kreskowiak23-Oct-08 10:44
mveDave Kreskowiak23-Oct-08 10:44 
GeneralRe: textbox Pin
Guffa23-Oct-08 13:58
Guffa23-Oct-08 13:58 
QuestionHow do you get the rectangular coordinates for Bookmarks in Word 2000 / 2003 ? Pin
Tomb42123-Oct-08 8:09
Tomb42123-Oct-08 8:09 
Questiontext box Pin
kewyn23-Oct-08 7:55
kewyn23-Oct-08 7:55 
AnswerRe: text box Pin
Dave Kreskowiak23-Oct-08 8:24
mveDave Kreskowiak23-Oct-08 8:24 
QuestionNeed Despriate Help with LPR printing Pin
Trey549823-Oct-08 7:47
Trey549823-Oct-08 7:47 
AnswerRe: Need Despriate Help with LPR printing Pin
Dave Kreskowiak23-Oct-08 9:03
mveDave Kreskowiak23-Oct-08 9:03 
GeneralRe: Need Despriate Help with LPR printing Pin
Trey549823-Oct-08 9:26
Trey549823-Oct-08 9:26 
QuestionInsert graphic image into PDF Pin
Cory Kimble23-Oct-08 6:34
Cory Kimble23-Oct-08 6:34 
AnswerRe: Insert graphic image into PDF Pin
Dave Kreskowiak23-Oct-08 7:37
mveDave Kreskowiak23-Oct-08 7:37 
QuestionProcess.Start Pin
KreativeKai23-Oct-08 6:30
professionalKreativeKai23-Oct-08 6:30 

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.