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

Does SqlCommandBuilder.GetUpdateCommand() need to be called before using SqlDataAdpater.Update()?

When I use a SqlCommandBuilder to push updates/inserts/deletes to the server do I need to call .GetUpdateCommand(), .GetInsertCommand(), and .GetDeleteCommand()? using (var adapter = new SqlDataAdapter("select * from MyTable", _connection)) using…
Scott Chamberlain
  • 124,994
  • 33
  • 282
  • 431
6
votes
1 answer

Can you use ADO.NET SQLCommandBuilder with composite keys?

I have a database table with 6 columns. The primary key is a composite key made up of 5 of the 6 columns I am trying to use the SqlClient.SqlCommandBuilder.GetDeleteCommand to delete the row. However I am getting the following…
Laura
4
votes
2 answers

ADO.NET CommandBuilder, InsertCommand and Default Constraints

I ' am copying data from table A to table B. Table B has a nullable column that has a default constraint value of 0. In general I set values of columns using the following accessor. public object this[string columnName] { get { return…
Rookian
  • 19,841
  • 28
  • 110
  • 180
4
votes
1 answer

How to use datetime value in an SSIS expression builder to formulate SQL command?

I am trying to use Ado.Net Sql command to select data from a table with a date filter. SELECT COLUMN1 , COLUMN2 FROM TABLENAME WHERE DATE_INSERTED > @[User::LastInsertDate] Both Date_Inserted and @[User::LastInsertedDate] are of type…
user1210891
  • 63
  • 1
  • 2
  • 6
4
votes
3 answers

How does SqlCommandBuilder do its stuff and how can I stop ReSharper's suggestion to delete it?

I don't understand how SqlCommandBuilder does its thing. I have the following code: public void TestCommandBuilder() { var pubsDataSet = new DataSet("Pubs"); var pubs = ConfigurationManager.ConnectionStrings["PubsConnectionString"]; var…
comecme
  • 6,086
  • 10
  • 39
  • 67
3
votes
3 answers

WinForms DataGridView - update database

I know this is a basic function of the DataGridView, but for some reason, I just can't get it to work. I just want the DataGridView on my Windows form to submit any changes made to it to the database when the user clicks the "Save" button. I…
Geo Ego
  • 1,315
  • 7
  • 27
  • 53
3
votes
1 answer

SqlCommandBuilder Inner Join Update

I have SQL tables as Lessons and Classes. Lessons table has primary key LessonID and Classes table has primary key ClassID. Also ClassID column is foreign key at Lessons table. I import data with SqlDataAdapter to DataSet in C# using query: select *…
Sertan Pekel
  • 593
  • 2
  • 5
  • 23
2
votes
0 answers

DataAdapter .Update does not update back table

my problem is very common, but I have not found any solution. This is my code: public async Task RollbackQuery(ActionLog action) { var inputParameters = JsonConvert.DeserializeObject(action.Values); var data =…
2
votes
1 answer

What is use of Command Builder in ASP.NET?

Command builder builds Parameter Object. What does it mean by parameter object? Why are they created ? Why does Derive Parameter method need extra round trip to Data store ?
user284291
2
votes
3 answers

Pass string array as parameter in SQL query in C#

In my application written in C# , I am writing a SQL query. Following is the query SELECT [Resource No_] where [Resource No_] In (@resources) @resources is user input parameters having one or more that one strings. My query is failing without…
user2739679
  • 827
  • 4
  • 14
  • 24
2
votes
2 answers

Insert Update Delete Datagridview using SQL Server stored procedures?

I'm new to vb.net. Please bear with me. I would like to learn how to insert, update, delete data in a Datagridview. So far I learned the best approach to this is to bind the DatagridView to a DataTable? The requirement is to use stored procedures.…
cool water
  • 25
  • 2
  • 7
2
votes
2 answers

How to use SQL Command Builder and SQL Data Apdater

I read SQL Command Builder class from http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommandbuilder.aspx and I found that I can show update done on dataset/database using select and update command. SQL Command Builder concept is…
Rushabh Shah
  • 277
  • 4
  • 10
  • 21
1
vote
1 answer

SqlCommand (CommandType Text) retrieve param collection

Is there a way to get the parameter collection from SqlCommand when CommandType = Text? For instance: string MyDinamicSql = @"SELECT * FROM USERS where USERName = @Param1 and USERLogin=@Param2"; SqlCommand comand =…
rd_rscan
  • 192
  • 3
  • 15
1
vote
0 answers

/Giveaway Command not working with no console errors?

I am trying to create a simple /giveaway command and came up with this: const { ActionRowBuilder, ModalBuilder, SlashCommandBuilder, TextInputBuilder, TextInputStyle } = require('discord.js'); module.exports = { data: new…
1
vote
1 answer

C# SQLCommandBuilder Help

I have project where i want to use the sqlcommandbuilder. My only problem is that i can not find a decent example of how to use it, or just simply does not understand why it is used like that. I am building my application based on 3-tier…
user717186
1
2 3 4 5