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
3
votes
2 answers

VS2005/VS2008 DataSet designer, insert a row into a table that has an autogenerated guid column

I have a strongly typed DataTable created with the VS2005/VS2008 DataSet designer. The table has a Primary Key column that is a guid, which gets populated by SQL server. The problem is when I want add a row (or multiple rows) to my DataTable and…
Doctor Jones
  • 21,196
  • 13
  • 77
  • 99
3
votes
1 answer

Can we fill DataSet without DataAdapter?

I know that we normally fill DataSetwith the help of DataAdapter's Fill method, but I want to know that Can we fill DataSet without DataAdapter? Any idea ?
Amit
  • 21,570
  • 27
  • 74
  • 94
3
votes
3 answers

how to save the DataSet after making changes to the database?

if I have a DataSet called myDs and I edit a field in it by direct access in a loop like the following: for (int i = 0; i < myDS.Tables[TableName].Rows.Count; i++) { //some function or web method to get the id value of the record being updated …
TopDeveloper
  • 542
  • 2
  • 14
  • 43
3
votes
1 answer

using DataAdapter to populate table

I have a disconnected dataTable that contains a few records. I am using the following function to get the dataTable. static System.Data.DataTable ReadSetUpTable(string queryStr,SqlConnection sc) { try { var command = new…
abhi
  • 3,082
  • 6
  • 47
  • 73
3
votes
3 answers

"Like" query in adapter c#

I have a data adapter that was created from my data set. i want to do this query: Select Body WHERE Body Like '%@INPUTTEXT%'. how can i do it? i want the "@INPUTTEXT" to be a parameter but because of the "' " it's a simple text...
aharon
  • 7,393
  • 10
  • 38
  • 49
3
votes
5 answers

Remove Row through DataAdapter

I've initialized a dataAdapter : string sql = "SELECT * From localitati"; da1 = new System.Data.SqlClient.SqlDataAdapter(sql, con); da1.Fill(ds1, "localitati"); And this works just fine. The problem is when i try to delete a record and update the…
Alex
  • 10,869
  • 28
  • 93
  • 165
3
votes
3 answers

How to format OracleNumber generically

I built a small query tool for Oracle with CSV export function with an OracleDataAdapter to fill a dataset that is displayed in a DataGrid (WinForms). At first I used .NET types (DateTime, decimal, string,...) but I got overflow exceptions in some…
Koen
  • 3,626
  • 1
  • 34
  • 55
3
votes
5 answers

Import Excel file to SQL Server row-by-row

I'm importing an Excel file (about 1000 records only) to a dedicated SQL Server database. As I need to work on the incoming data from Excel (add a GUID per row, some data conversions) I want to do it row by row and don't want to bulk import (I have…
Dennis G
  • 21,405
  • 19
  • 96
  • 133
3
votes
1 answer

DataSet - Ensuring PrimaryKey data when Filling with a query that is an outer join

When filling a DataSet, I am using the "AddWithKey" value for the DataAdapter's MissingSchemaAction. According to MSDN: Adding schema information to a DataSet before filling it with data ensures that primary key constraints are included with…
JustLooking
  • 2,405
  • 4
  • 28
  • 38
3
votes
2 answers

Change DataGridViewColumn to DataGridViewComboBoxColumn in bound DataGridView

I have a DataGridView bound to a DataTable and I use a SQLiteDataAdapter to update one SQLite database. I'm trying to make one of the columns a DataGridViewComboBoxColumn, but despite I can put items on it and change its cell values I'm no longer…
3
votes
1 answer

Filling dataset with dataadapter with row limit

I need to modify the following code so that the number of rows are limited. // create the connection OracleConnection conn = new OracleConnection("Data Source=oracledb; User Id=UserID;Password=Password;"); // create the command for the stored…
Jimmy
  • 3,224
  • 5
  • 29
  • 47
3
votes
4 answers

C#: Update dataset without any primary key

Is it possible in C# to use an OleDbAdapter and use its Update method for a dataset when a table has no primary key and how can I do this?
Partial
  • 9,529
  • 12
  • 42
  • 57
3
votes
2 answers

Writing changes to a SQLite database using SqliteDataAdapter

What am I missing from the following code? In this code fragment, I am reading in a table from a SQLite database. I am then updating a cell, and then reading back the change. This code is a simplified version of larger code, but it illustrates the…
Sarah Weinberger
  • 15,041
  • 25
  • 83
  • 130
3
votes
1 answer

How to set InsertCommand parameter as function call?

I working on a GIS application which uses the PostgreSQL database with PostGIS extension. I already created the data access logic for entire project and everything works fine except the geometry value insert. I have to pass geometry value as a…
ggabor
  • 1,642
  • 4
  • 18
  • 23
3
votes
3 answers

Why DataAdapter is not Disposable

I know there is probably an obvious reason but I can't find it.. I usually use the using statement during DB connection and data reading, but I can't use it on DataAdapter because it doesn't implement IDisposable. Also: how can it behave after…
Tobia Zambon
  • 7,479
  • 3
  • 37
  • 69
1 2
3
28 29