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
0
votes
1 answer

Why SQLCommandBuider not DELETING?

In the following code UPDATE is working but DELETE is not working. When I DELETE row it delete it and GridView1 does not show it but database still has it. customers has PrimaryKey. using (SqlConnection connection = new SqlConnection(conString)) …
Amit
  • 21,570
  • 27
  • 74
  • 94
0
votes
0 answers

Is there a way to use SqlCommandBuilder with SQL queries with JOIN statement

I use this code to show data in my DataGridView dt.Clear(); DGVEdit.DataBindings.Clear(); da = new SqlDataAdapter("SELECT DISTINCT DocDtls.PrimDocNum, DocDtls.DocNum, DocDtls.Warehouse, DocDtls.Orientation, Transactions.Code, Transactions.QtyIn,…
Csharp Newbie
  • 303
  • 1
  • 10
0
votes
2 answers

How do I correct a syntax error in command builder?

I am trying to get this routine to update my autolog table in access. Every time I run it, I get a syntax error in the INSERT command. Now when I look at the INSERT command from the command builder, I can see that there are values missing that are…
0
votes
2 answers

C# SqlCommandBuilder , CommandUpdate - how to write correct update based on select with outer join tables

I want is to update 2 fields: p.FlagaWaznosci and p.Notatka My select looks like: Select DISTINCT…
Adam Zbudniewek
  • 107
  • 2
  • 12
0
votes
1 answer

How do I update a database using a DataSet?

I am trying to update my database with the contents of a DataSet, but currently am unable to do so with the following code: string s = "Select number,name from table where id = 5 and num = 20"; SqlDataAdapter adapter = new SqlDataAdapter(s,…
laila
  • 23
  • 2
  • 6
0
votes
0 answers

Commandbuilder does not update data from datatable

I have the following code in my WPF project: string query2 = "SELECT * FROM Anamnese_VMBO"; string connectionstring = IDbConnection con1 = new OleDbConnection(connectionstring); …
James VH
  • 69
  • 1
  • 7
0
votes
0 answers

modify oledb data adapter update command

I am using an oledb data adapter to update an access database with information displayed in (and possibly edited) a datagridview on a form. The stock update command (from commandbuilder) does work and update the data that has been modified. However,…
Perry 59
  • 35
  • 5
0
votes
1 answer

C#.NET sqlDatabase CommandBuilder and DataAdapter: The name 'Adapter' does not exit in the current context

I've been following a C# .Net tutorial online. Created a class and have declare the variable Adapter1 for my DataAdapter. I'm using CommandBuilder with Adapter1 to update, save, delete or insert new record to the database. The problem I'm having is…
0
votes
1 answer

DataAdapter / CommandBuilder - Unique constraint on multiple columns

Im using command builder to auto generate SQL statements and DataAdapter to fill DataSet Generally works well but now I have issue with Unique constraint on multiple columns I have in DB (PostgreSQL) such unique index CREATE UNIQUE INDEX idx_uniq…
Maciej
  • 10,423
  • 17
  • 64
  • 97
0
votes
1 answer

Strategy for selecting records for DataSet

In Most common cases, we have two tables (& more) in DB termed as master (e.g. SalesOrderHeader) & chirld (e.g. SalesOrderDetail). We can read records from DB by one Select with INNER JOIN and additional constaints WHERE for lessen volume data for…
0
votes
1 answer

.net dataadapter update executes on wrong table

I have a typed dataset with 2 datatables, TableX and TableY. Created in designer. No TableAdapters. When I fill the TableX I run an SQL and fetch data from another table, TableZ. The table fills up with records and the TableX.tableName is…
Martin
  • 1,521
  • 3
  • 18
  • 35
0
votes
1 answer

Unable to refresh DataGridView that is bound to a DataTable

I've tried everything using other answers on the forum. I simply want my data grid view to dynamically update when i select the update button on my form after making a change. Ref the code below, the current result is that when I add a new row and…
OJB1
  • 2,245
  • 5
  • 31
  • 63
0
votes
1 answer

How to reset Identity Column Of Table when a record is deleted?

I have a Datagridview which gets populated with some data from SQL Server. This works fine no problem at all. Each time I insert or update records in the table, I want to RESEED an IDENTITY column named CarID of a table, but the sequence of IDS…
user8820917
0
votes
0 answers

Modifying any SQL command string to remove a specific column prior to an insert or update to database

I'm trying to remove columns, which exist in ALL of our tables, before adding or updating a record to the table. This is necessary due to some features of Azure, and synchronizing tables on mobile devices. In the example below I am removing named…
E. A. Bagby
  • 824
  • 9
  • 24
0
votes
1 answer

SQLDataAdapter.Update() not Updating when RowState = Modified

I am trying to set up a program that, when a user updates an item description, will update the database upon the save of the form. I have set up everything I have found that is required and yet the adapter never updates. It selects and inserts great…
ARidder101
  • 315
  • 2
  • 6
  • 16