Questions tagged [sqlcommandbuilder]

Automatically generates single-table commands that are used to reconcile changes made to a DataSet with the associated SQL Server database.

Automatically generates single-table commands that are used to reconcile changes made to a DataSet with the associated SQL Server database.

71 questions
1
vote
1 answer

ADO.NET DBConcurrencyException - Trying to update an already deleted row

Why is ADO.NET throwng a DBConccurencyException, when I try to update a row that is already deleted by another process, instead of just ignoring the deleted row? Is there any available option in ADO.NET to ignore this fact? I am using…
Rookian
  • 19,841
  • 28
  • 110
  • 180
1
vote
1 answer

How to pass parameters to dataadapter?

I have code below which i use to select data from sql database table using dataadapter but i throws an error: "Must declare the scalar variable"@UserName" Where is the mistake in code???? I have tried the code below which throws an error "Must…
user8820917
1
vote
1 answer

C# SqlCeDataAdapter not updating values from database when calling Adapter.Update() after changing values from datagridview

i have a code which contains a local database 'database1.sdf' along with table 'Employees' with some values. I am adding all rows from database to a datagridview using Datagridview.Datasource property. All rows are fetching from table! Fine! when i…
1
vote
1 answer

Derive parameters of a stored procedure in VBA

I've tried searching a lot of places and can't quite find what I'm looking for. I want to write a sub routine in vba that will tell me the parameters of a stored procedure stored on SQL Server. I know how to execute a stored proc with parameters…
MountainMJ
  • 69
  • 1
  • 7
1
vote
0 answers

SqlCommandBuilder.SetAllValues is not working anymore

I set the value for my SqlCommandbuilder.SetAllValues = false; Some year ago when I implemented it I checked with profiler and it worked correct, only the changed fields are in the update command generated by the SqlCommandBuilder. But now I…
GuidoG
  • 11,359
  • 6
  • 44
  • 79
1
vote
1 answer

Update SQL Database Table Using a TableAdapter with SqlCommandBuilder and a Worksheet exported to a DataTable

I am exporting data from a spreadsheet worksheet range into a datatable (dtpHExportDataTable). When I call ShowResult(dtpHExportDataTable), the grid form displays the correct datatable information (headers and rows of data). Likewise, when I call…
1
vote
2 answers

How to use SQL Task to update a table

I have this SQL to update modified records in my table. It runs in SSMS, but how do I implement this in SSIS package? I tried to use SQL task but it does not recognize the columns. I can put a select within a data flow ole db source (sql command has…
1
vote
1 answer

SqlCommandBuilder using table name instead of view

I am using a SqlCommandBuilder object to generate update statements from Select statements in a SqlDataAdapter. My problem is that in my Select statement I am selecting from a view called vwUsers. the SqlCommandBuilder object I used generated an…
A B
  • 343
  • 4
  • 9
1
vote
0 answers

SqlDataAdapter RowUpdating Event Seems to Mutate Update Command

I followed a tutorial to use the .Net SqlDataAdapater.Update method to generate a table update script. However, it appears that somewhere along the way the SqlCommands are getting mutated in such a way as to be syntactically incorrect. What is even…
Dan Forbes
  • 2,734
  • 3
  • 30
  • 60
1
vote
1 answer

SqlDataAdapter.update() not updating database

I am searching for (PostId,UserId) into PostLikes table using SqlDataAdapter, if the row is found , I am using SqlCommandBuilder.GetDeleteCommand() to generate the delete instruction and deleting the underlying row, if the row is not found, then I…
Vivek
  • 363
  • 8
  • 25
1
vote
2 answers

SqlCommandBuilder.DeriveParameters(command) and IsNullable

I have written an O/R database wrapper that generates some wrapper methods for stored procs it reads from the database. Now I need to produce some custom wrapper code if an input parameter of a stored proc is defaulted to NULL. The problem is - I…
Andrey
  • 20,487
  • 26
  • 108
  • 176
1
vote
2 answers

dataset doesn't update anything in C#

I have written this procedure in ms-sql ALTER proc [dbo].[gravacliente] AS SELECT idcliente, Nome, Endere, tel_empresa, celular, UF, CEP, Email, Contato, Referencia, OBS, Nasc, cpf, cnpj, Iest FROM tbcliente and this code,…
alejandro carnero
  • 1,774
  • 7
  • 27
  • 43
1
vote
1 answer

SQL Command Builder Query values

I have a SQLDataAdapter, in my query i am fetching two fields, ID(PK), Name. I registered a sql command builder to my data adapter so i don't have to write queries to update table in database. when I call the da.update() method, sql throws error…
alphaprolix
  • 601
  • 2
  • 10
  • 25
0
votes
2 answers

SqlCommandBuilder and SQL Server Computed Columns - Error

What is the right way to avoid errors on INSERT and UPDATES with a SqlDataAdapter/SqlCommandbuilder when the SQL Statement used to SELECT has a computed column as one of the return fields? I get the error now that "The column Amount cannot be…
BuddyJoe
  • 69,735
  • 114
  • 291
  • 466
0
votes
1 answer

Why calling DataTable.Clear() then DBDataAdapter.Update(DataTable) does not clear the table in database?

I try to use the code sample in DBDataAdapter.Update Method to clear a table in a database. using (SqlConnection connection = new SqlConnection(connectionString)) { SqlDataAdapter adapter = new SqlDataAdapter("SELECT * FROM WebCam",…
kennyzx
  • 12,845
  • 6
  • 39
  • 83