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

How to work with autoincrement keys and SqlDataAdapters to add new rows do database

So, i have this in-house data access framework that i have to maintain and i'm to add Transactions to it. I am having problems putting in one package: Transactions, SqlDataAdapters, SqlCommandBuilders and tables with primary keys defined as…
sergio
  • 1,026
  • 2
  • 19
  • 43
0
votes
1 answer

SqlDataAdapter.Update not writing to table until second update

I have a program developed in C# 2010 Express with a form consisting of a DataGridView with individual cell editing fields below it. When a row is selected (clicked at its left end), the values in the row are copied into the editing fields. …
Jim I.
  • 13
  • 4
0
votes
1 answer

Update SQL Server Using SQL Command Object that has Join

I am trying to get my head around data access using VB.NET 2010. I am slowly building a dummy application of contacts. I have it working with an SQL command object to handle the ADD, UPDATE and DELETE but it inly supports single table queries. I…
0
votes
2 answers

SqlDataAdapter.Update(dataset) method inserts new rows but does not updates existing rows

I am creating winform application that have DataGrigView to present a table. I have a DAL class that is responsible to work with DB. There are one method that loads data of the table: public static void GetItemsByOrder(int orderId, ref DataSet…
Lev Z
  • 742
  • 9
  • 17
0
votes
2 answers

sqlCommandBuilder update not working as expected

I'm trying to do an update using CommandBuilder. The code works perfectly when the the code fetching the data is retrieved by a button command, but when I fetch the data from the page_load, update fails. The program simply fetches data from a…
0
votes
1 answer

Will UPDATE be called if I "change" a column value to what it already is?

I am trying to figure out if I need additional logic to avoid a useless call to my SQL db, or if SqlDataAdapter.Update() will do the right thing. If I have this code: SqlConnection sqlconn = new…
Conrad
  • 2,197
  • 28
  • 53
0
votes
0 answers

Filling SQL Database Table from DataGridView

Once again i am turning to you for help. I am a little stuck when trying to save data entered in a DataGridView back to the SQL table. I have followed a number of posts but just cant seam to figure it out I declare the following variables globally…
0
votes
2 answers

Use of SqlCommandBuilder in ASP.NET

I have used the following code to add the feedback entered to the web form into a database. The code works fine. But when I try to deleted thi statement SqlCommandBuilder objcb = new SqlCommandBuilder(objDa); I am getting an error I mean it is…
Sheetal
  • 853
  • 6
  • 15
  • 22
0
votes
1 answer

Using or Avoiding CommandBuilder in ADO.NET

Is it advisable to use CommandBuilder or should one manually create the InsertCommand, DeleteCommand and UpdateCommand for SqlDataAdapter? The obvious advantage to using CommandBuilder is less developer time, the disadvantage being more run time.…
Deepanjan Nag
  • 901
  • 3
  • 14
  • 26
-1
votes
1 answer

why we going for sqlcommandbuilder?

Option 1: to insert data in a db SqlCommand cmd = new SqlCommand("INSERT INTO table_name(eid,eName,Dept) values('"+ textBox1.Text +"','"+ textBox2.Text +"','"+ Textbox3.Text +"'", con); cmd.ExecuteNonQuery(); Option 2: SqlDataAdapter sqlda = new…
ron_87
  • 17
  • 4
-1
votes
1 answer

Dynamic SQL issue - C# Forms (Datagridview)

I am currently trying to update my DataGridView to my database. I want to be able to update it with the enter key. But I am getting this error: "Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not…
1 2 3 4
5