Questions tagged [dataadapter]

DataAdapter is a .Net framework class that facilitates communication between a DataTable and a database.

DataAdapter is a framework class that facilitates communication between a and a database.

434 questions
5
votes
2 answers

Why it doesn't save changes into datatable from datagridview?

I have binded datagridview with datatable (Growns). My main goal is, that user can work with datagridview (dataGridView1), filling and updating data and when button SAVE is clicked, all data would be saved into datatable, because I need it for…
user2528094
  • 53
  • 1
  • 1
  • 6
5
votes
2 answers

Update using MySqlDataAdapter doesn't work

I am trying to use MySqlDatAdapter to update a MySql table. But, the table never updates!!! I did this before but with SQL server. Is there anything else that is specific to MySql that I am missing in my code? DataTable myTable = new…
usp
  • 797
  • 3
  • 10
  • 24
5
votes
2 answers

Result set is object for 1 record, array for many?

I can't believe it, but all indications are that my PowerShell code is returning the result of a SELECT query that finds 1 record as an object, but if there are two or more records the same code returns an array of objects. What am I doing…
5
votes
1 answer

Filling DataTable from DataAdapter - the wrong column is selected as primary key

I am filling a datatable object through a dataadapter pulling data from a MS-SQL database. For some reason the wrong column is set as the primary key on the datatable. I have tried FillSchema and MissingSchemaAction.AddWithKey to no avail. The…
Drew R
  • 2,988
  • 3
  • 19
  • 27
5
votes
4 answers

Refresh datagridview win forms after updating the database from a child form

how to refresh datagridview after making changes on the database from another form, after closing child form i tried to refresh the datagridview with click event but it's not working, do i have to use dataset ? //create an…
sevoug
  • 169
  • 1
  • 1
  • 13
5
votes
4 answers

How to retrieve column default value from MS SQL data table

I am using DataAdapter.FillSchema to retrieve tables' schema from MS SQL. Unfortunately this doesn't return the default value for the columns. Is there a way to retrieve this value as part of the schema in a fast and efficient way as I need to…
Daniel
  • 1,391
  • 2
  • 19
  • 40
4
votes
3 answers

DataAdapter.Fill too slow

I know DataAdapters have performance issues, but are there any ways around it that might be faster? At the moment, the DataAdapter.Fill method is taking 5-6 seconds on 3000 records, which is too slow for my app. If I remove the Fill line and just…
Skoder
  • 3,983
  • 11
  • 46
  • 73
4
votes
3 answers

C# - Using DataAdapter to Update SQL table from a DataTable - SQL table not updating

I select * from an Excel spreadsheet into DataTable dt. I want to take those values and update the SQL table. The SQL table exists because of a manual import to SQL from the original Excel spreadsheet, has a primary key set. The user updates the…
cjjeeper
  • 93
  • 3
  • 4
  • 13
4
votes
4 answers

Returning a single row in a strongly typed DataSet in C#

I have a Strongly typed Dataset TableAdapter in C#, how do I get a single row from it?
Orhan Cinar
  • 8,403
  • 2
  • 34
  • 48
4
votes
2 answers

SQLiteDataAdapter Update method returning 0

I loaded 83 rows from my CSV file, but when I try to update the SQLite database I get 0 rows... I can't figure out what I'm doing wrong. The program outputs: Num rows loaded is 83 Num rows updated is 0 The source code is: public void…
Kiril
  • 39,672
  • 31
  • 167
  • 226
4
votes
4 answers

Error : Update requires a valid UpdateCommand when passed DataRow collection with modified rows

I am using Paging to show data in datagridview, but when i try to Update any data with updatebutton data should be updated In datagridview as well as in database. But I get this error: Update requires a valid UpdateCommand when passed DataRow…
Durga
  • 1,283
  • 9
  • 28
  • 54
4
votes
1 answer

SQLite/ADO.NET- Data Adapter doesn't write correct number of rows to SQLite file

Continuing my saga of converting program output from CSV to SQLite, I've run into another problem. I am taking a text file, breaking it up by line and commas, and putting the results of that into a list. I am then following this tutorial on how to…
nerdenator
  • 1,265
  • 2
  • 18
  • 35
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
4
votes
2 answers

DataAdapter.Fill() behavior for row deleted at the data source

I'm using the DataSet/DataTable/DataAdapter architecture to mediate between the database and my model objects, which have their own backing (they aren't backed by a DataRow). I've got a DataAdapter with AcceptChangesDuringFill = False,…
John Calsbeek
  • 35,947
  • 7
  • 94
  • 101
4
votes
2 answers

Reload data using TableAdapter

private void UserList_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'workOrdersDataSet.users' table. You can move, or remove it, as needed. this.usersTableAdapter.Fill(this.workOrdersDataSet.users); } How…
Cocoa Dev
  • 9,361
  • 31
  • 109
  • 177
1
2
3
28 29