Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 16th, 2007, 01:01 PM
Authorized User
 
Join Date: Dec 2006
Posts: 43
Thanks: 4
Thanked 0 Times in 0 Posts
Send a message via MSN to Yasho
Default modifying cell value in database

Using vb.net 2003,using a oleDBadapter Have a table in access database - tblEmployee.
Objective
Get the data for a employee using his or her EmpID
and change the status of the employee at run time
I have 2 buttons, btnLoad to load employee data, Update to modify the database tbl. 3 text Boxes, txtEmpId, txtEmpLastName, txtStatus
all 3 are bound to dsEmpMod1.tblEmployee

I have created the data adapter, dataset, and they are working
i used
daempMod.selectcommand.commandtext="search * from tblemployee where EmpID=" & "xxxxxxxxx"
dsempMod1.clear()
daempMod.fill(dsempmod1)
I have tested and dataset is loading.
when select command is executed, It populates 2 textboxes, txtMovieID and txtStatus. Status is changed to IN or Out depending on the employee state. Then this has to loaded back in tblEmployee
I have tried so many things and none working that frustration has clogged my mind.
after I change the dataset "status" value to new value to new status
daEmpMod.update(dsEmpmod1) gives error so as several other commands
daEmpmod.Update(dsEmpMod1) works fine if I have to add a new Row but when modifying a row gives error.

Can you tell me what do I do now. Please give the code syntex and explicit comments as I am a self tought beginer and not very good at it.


yvk
__________________
yvk
 
Old February 20th, 2007, 08:21 AM
Authorized User
 
Join Date: Nov 2006
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ef1196
Default

Have you configured an Update command for your DataAdapter?



Best Regards,
Earl Francis
 
Old February 20th, 2007, 11:27 PM
Authorized User
 
Join Date: Dec 2006
Posts: 43
Thanks: 4
Thanked 0 Times in 0 Posts
Send a message via MSN to Yasho
Default

please explain what you mean by configuring updat command. I am naive in vb.net

yvk
 
Old February 21st, 2007, 08:47 AM
Authorized User
 
Join Date: Nov 2006
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ef1196
Default

This is directly from MSDN:

http://support.microsoft.com/kb/308055




Best Regards,
Earl Francis





Similar Threads
Thread Thread Starter Forum Replies Last Post
cell is empty while using For Each cell In Range jase2007 Excel VBA 4 April 5th, 2012 10:20 PM
Modifying a database and a form DrCruces Access 8 December 14th, 2006 06:05 AM
I need to refer a cell within a cell like =RC[ RC2 chakravarthi_os Excel VBA 1 September 24th, 2006 08:19 AM
if the cell content is a part of another cell cont sriramus Excel VBA 1 November 15th, 2005 10:20 AM
Lose cell Text when editing cell in VSFlexGrid 6 bobcratchet VB How-To 0 July 30th, 2004 09:32 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.