Questions tagged [updatecommand]

47 questions
2
votes
1 answer

Added multiple records to DataSet but only one record is stored in database (C#)

OK this may be a bit of a long one but please bear with me. I searched high and low and I can't seem to find a clear answer about my particular issue. As the subject above states, I am using DataSets to retrieve, edit, insert and update records in…
2
votes
2 answers

MFC CToolBar update mechanism bug?

In Visual Studio, MFC CToolBar buttons are updated by ON_UPDATE_COMMAND_UI which is sent during idle state. I suppose this mechanism is buggy if I change enable/disable state of the button in ON_UPDATE_COMMAND_UI handler. Specifically: Suppose the…
guan boshen
  • 724
  • 7
  • 15
2
votes
1 answer

DataSet doesn't generate the updatecommand in new tables

When i try to insert a my database's table in my dataset, it doesn't generate the update command like had done with other tables. It generates only insert and select commands How can i do to generate it without write it manually? thanks
Luca Romagnoli
  • 12,145
  • 30
  • 95
  • 157
2
votes
0 answers

Gridview update data corruption when database changed during edit

I'm having a little problem with data corrupting when updating tables from a GridView. I must admit this is my first attempt at asp.net but I am reasonably familiar with C#. Firstly, some background. We have some 3rd party inventory/order processing…
2lostkiwis
  • 21
  • 2
2
votes
1 answer

UPDATE gridview row error

Safinn
  • 622
  • 3
  • 15
  • 26
2
votes
2 answers

SQL update command executed but no change to the database

I am quite new to the ASP.NET technology and I stumbled across peculiar problem with my app. I am trying to update a boolean database column to set the value to True (1) whenever a user clicked a button on the RadGridView data rows. The button seems…
learner
  • 73
  • 1
  • 8
2
votes
1 answer

updatecommand in asp page not working

ok i have solved my last question by using update parameters instead und putting templatefields on my gridview instead of boundfields. it is displayed alright, only thing is the update button doesn't seem to work. when i click it, it just returns to…
LeonidasFett
  • 3,052
  • 4
  • 46
  • 76
1
vote
1 answer

C# dataset fails to update the SQL Server database table

I'm having trouble understanding what I'm doing wrong here. I've been able to select and populate forms with data from my SQL Server database with no problems. Now when I try to write back to the database through my modified dataset, nothing…
1
vote
2 answers

ASP.NET Update GridView statement

I am using VS2005 C# and SQL Server 2005. I have a GridView and this is my current Update statement: UpdateCommand="UPDATE [UserData] SET [UserID] = @UserIDe, [Username] = @Username, [Age] = @Age, [MemberType]=@MemberType WHERE [UserID] =…
gymcode
  • 4,431
  • 15
  • 72
  • 128
1
vote
1 answer

People API - Update Contacts - How to update individual fields instead of all (e.g. phoneNumbers) using GAS

in order to update my contacts phone numbers, I am using People API with following code: function updateContact(contactRn, contactEtag, contactPhone){ var bodyRequest = { "resourceName": contactRn, "etag": contactEtag, …
1
vote
2 answers

C# SqlDataAdapter Must declare the scalar variable Sql Exception

New to C# and working on a Windows Form application. I am attempting to execute an update query against a SQL database, but keep running into "Must declare the scalar variable" error and I do not understand why. The below code successfully opens the…
argent65
  • 33
  • 5
1
vote
1 answer

TableAdapter UpdateCommand on JOINed table

Suppose I have a DataGridView that is loading from a TableAdapter whose content is from 2 JOINed tables, so Table C is: SELECT A.*, B.name LEFT JOIN B ON B.id = A.b_id No UpdateCommand is generated for this by the wizard, I know. However, if the…
Will J
  • 13
  • 3
1
vote
1 answer

Correct Update Command for datagridview w/ Join in Select command SQL server

Not sure what i am doing wrong here keep getting a syntax error near "InTime". sqlmodDA.Update(sqlmodDS.Tables("XXX")) One button gets data (subBindDataGridView) to display on Data Grid View then edit is made next button (CommitChanges) writes…
1
vote
1 answer

Datagridview INSERT/SELECT/DELETE fail

I'm trying to create a master-detail form with datagridviews all in code. The SELECT/fill part is working fine, but I am having trouble with UPDATE/INSERT/DELETE (which should happen automatically when the form is closed). The following code gives…
1
vote
1 answer

How to update two data tables back to db using OleDb and DataAdapter in c#

I got two datatables from a mdb file using oledb and modified it. accessConnection.Open(); string selectQuery = "SELECT * FROM Students"; DataAdapter = new OleDbDataAdapter(selectQuery,…
1
2 3 4