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
41
votes
9 answers

How to use a DataAdapter with stored procedure and parameter

I want to fill a DataGridView control using DataAdapter. But I don't know how to do it since I'm using a stored procedure with parameter. Can someone cite an example please?
yonan2236
  • 13,371
  • 33
  • 95
  • 141
29
votes
4 answers

Android - What does adapter.notifyDataSetInvalidated do?

What does the method adapter.notifyDataSetInvalidated() accomplish? There is no documentation on it. I am trying to reload a ListView and notifyDataSetChanged or notifyDataSetInvalidated don't seem to accomplish anything.
Tawani
  • 11,067
  • 20
  • 82
  • 106
16
votes
10 answers

DataAdapter.Update() does not Update the Database

I'm sure there is an extremely simple reason that this one line isn't working, but it has evaded for the past week, so I'm hoping someone else will notice my fault. I have been working on this project for several weeks to a month. I have been using…
Miffed
  • 161
  • 1
  • 1
  • 3
12
votes
2 answers

What is the best practice to fill a DataSet or DataTable asynchronously in ASP.NET?

Given the following code, I have a few questions about best practices: string connectionString = @"Server=(local)\sqlexpress; Database=master; Integrated Security=true;"; using (SqlConnection connection = new SqlConnection(connectionString)) { …
Adrian Anttila
  • 2,038
  • 5
  • 22
  • 25
12
votes
2 answers

Update database with changes made to DataTable... confusion

If I fill a DataTable with DataAdapter.Fill(DataTable); and then make changes to a row in the DataTable with something simple like this: DataTable.Rows[0]["Name"] = "New Name"; how can I easily save those changes back to the database? I assumed I…
Jimmy D
  • 5,282
  • 16
  • 54
  • 70
11
votes
3 answers

DataAdapter: Update unable to find TableMapping['Table'] or DataTable 'Table'

This code snippet is throwing an error: Update unable to find TableMapping['Table'] or DataTable 'Table'.) on adapter.Update(ds); line Why it is throwing this type of error? SqlConnection con = new SqlConnection(); con.ConnectionString =…
Arif Ansari
  • 472
  • 1
  • 4
  • 12
9
votes
9 answers

Is datareader quicker than dataset when populating a datatable?

Which would be quicker. 1) Looping a datareader and creating a custom rows and columns based populated datatable 2) Or creating a dataAdapter object and just (.Fill)ing a datatable. Does the performance of a datareader still hold true upon dynamic…
Squiggs.
  • 4,299
  • 6
  • 49
  • 89
9
votes
1 answer

C# SQL Data Adapter System.Data.StrongTypingException

I get my data from SQL to Dataset with Fill. It's just one table with two columns (CategoryId (int) and CategoryName (varchar)). When I look at my dataset after fill method, CategoryId Columns seems to be correct. But in the CategoryName I have a…
René Stalder
  • 2,536
  • 5
  • 31
  • 50
8
votes
1 answer

SQLiteDatabase.openDatabase vs SQLiteOpenHelper.getReadableDatabase

Is there any difference between these two methods? Both return an opened SQLiteDatabase. Both can create a database if one doesn't exist. SQLiteOpenHelper also has getWriteableDatabase when read/write is needed... Which method should I use and…
GendoIkari
  • 11,734
  • 6
  • 62
  • 104
7
votes
9 answers

SqlDataAdapter.Fill() Timeout - Underlying Sproc Returns Quickly

I have a SqlDataAdapter that is being populated with 21 rows of data (4 columns). The sproc that drives it returns in a couple seconds in SQL Mgmt Studio, but the .Fill() takes 5 minutes. ArrayList ret = new ArrayList(); SqlDataAdapter da =…
Chris
7
votes
1 answer

DataAdapter does not need to make db connection open?

I try to use DataAdapter in C#.net. and still I do not understand something about DataAdapter. I read many article and blogs about DataAdapter and DataReader. I understood DataAdapter will open and close database automatically when they…
Expert wanna be
  • 10,218
  • 26
  • 105
  • 158
6
votes
1 answer

C# DataAdapter and DataSet with multiple table

I have read from many places that it is possible to fill a DataSet with multiple tables using a DataAdapter. It also does not say whether a single Update call can update all the tables in the DataSet. Can someone help me figure out how this can be…
Jake
  • 11,273
  • 21
  • 90
  • 147
6
votes
2 answers

Comparison of dataAdapter .Fill and .Update

I've been reading through the MSDN resources and several forums and still don't understand what's the difference between those two dataAdapter.Fill() and dataAdapter.Update(), I tried to use both of them to update the database from my program and it…
Andrew Taswin
  • 177
  • 2
  • 3
  • 13
5
votes
4 answers

C# Issue: What is the simplest way for me to load a .MDB file, make changes to it, and save the changes back to the original file?

My project that I am working on is almost finished. I am loading a .MDB file, displaying the contents on a DataGrid and attempting to get those changes on the DataGrid and save them back into the .MDB file. I am also going to create a function that…
OneShot
  • 609
  • 8
  • 20
  • 32
5
votes
1 answer

Define table names for results of multiple SQL selects in a single query

For example if I run the following query: select * from table1 select * from table2 And run it with a DB adapter (C#) I get a dataset with two tables. How can I define the names for the result tables in SQL? I can only do this inside the SQL. I…
LiorE
  • 111
  • 4
  • 9
1
2 3
28 29