Questions tagged [sqldataadapter]

Represents a set of data commands and a database connection that are used to fill the DataSet and update a SQL Server database.

The SqlDataAdapter, serves as a bridge between a DataSet and SQL Server for retrieving and saving data. The SqlDataAdapter provides this bridge by mapping Fill, which changes the data in the DataSet to match the data in the data source, and Update, which changes the data in the data source to match the data in the DataSet, using the appropriate Transact-SQL statements against the data source.

438 questions
2
votes
1 answer

C# SqlDataAdapter.Fill giving error about data conversion when passed datatable parameter

I'm trying to fill a datatable using a SqlDataAdapter in C#. I'm not very familiar with the objects, and am basically working off a template of someone else's code to try to figure out how it works. Here's the basic form. SqlCommand command…
Nick
  • 23
  • 1
  • 3
2
votes
0 answers

Notify RecyclerViewAdapter from MainActivity

In my MainActivity, I handle my methods for database changes and also the listen for an icon clicks in the toolbar. The icon performs that the list from database (shown in Recycler View) gets ordered ascending/descending. But the Problem is when i…
2
votes
0 answers

C# & SQL Server : escaping SQL column name AND param?

I get that using reserved keywords as column names is frowned upon, but in a database that I didn't design I'm running into just that. I understand escaping the column name as tableName.[Count] for any column using a reserved keyword, but what…
Tony D.
  • 551
  • 1
  • 10
  • 26
2
votes
1 answer

SqlDataAdapter Fill gives NULL primary keys

So I have a bit of a head scratcher I am looking for help with. We recently moved an ASP.Net web forms app from .Net 3.5, Win 2003, and SQL 2008 to .Net 4.5, Win 2008, and SQL 2012. The app ran for 4+ years on the old platform without any issues.…
Rozwel
  • 1,990
  • 2
  • 20
  • 30
2
votes
1 answer

Can the SqlDataAdapter refresh itself when the table is changed from an outside source?

My SQL Server table is updated from outside of my program (from a SQL trigger, actually), so the DataSet doesn't realize that there are changes and my DataGrid doesn't update unless I explicitly call SqlDataAdapter.Fill() again (e.g. with a…
ewall
  • 27,179
  • 15
  • 70
  • 84
2
votes
1 answer

The connection's current state is connecting

I am writing web application in C#, and database is MSSQL Express 2012. When i use SqlDataAdapter i get the Error: ExecuteReader requires an open and available Connection. The connection's current state is connecting. SqlDataAdapter da = new…
maxileft
  • 225
  • 4
  • 15
2
votes
2 answers

How can I synchronise two datatables and update the target in the database?

I am trying to synchronise two tables between two databases. I thought that the best way to do this would be to use the DataTable.Merge method. This seems to pick up the changes, but nothing ever gets committed to the database. So far I…
Craig
  • 45
  • 1
  • 4
2
votes
3 answers

SqlDataAdapter Close connection method

I have a code like this in my program and I believe that it's not closing the connection after that the data is getting filled in. public static string ConnectionInfo =…
Ahad Porkar
  • 1,666
  • 2
  • 33
  • 68
2
votes
2 answers

Insert a dataSet into a SQL table

I have a dataset filled up with data from 3 different table. I want to store that dataset in an empty table in SQL, i have already created the table. public void SaveDataBaseTailleALL(DataGridView dataGridViewRALSelectedTaille, DataSet oDSALL) { …
user2967732
  • 25
  • 1
  • 1
  • 5
2
votes
2 answers

Update Single Record with ADO.NET SqlDataAdapter

I'm working with a SqlDataAdapter on a Windows Form with C#. I have a BindingSource linking it to my fields with functional record traversal and saving changes back to the database. I'd like to give users the option of updating the database with…
Cameron Sumpter
  • 454
  • 1
  • 4
  • 13
2
votes
1 answer

DATAADAPTERS AND NULLS

I am trying to pass a null to DataAdapter.Fill. My SQL statement accepts nulls but I get a return that nulls are not acceptable. JUEGO.etreDataSetTableAdapters.CountyTableAdapter etreDataSetCountyTableAdapter = new …
2
votes
1 answer

SqlDataAdapter Insert poor performance

I wrote some payroll processing software which ultimately writes data out to a SQL Server table using SqlDataAdapter.Insert(). (I am using the default Insert command created with SqlCommandBuilder().) I am using the .NET Framework 4 on Windows 7,…
Conrad
  • 2,197
  • 28
  • 53
2
votes
1 answer

populating a list view with sql database items

My application is based on displaying a dialog box when the user enters the "add category" button. It then should save data into an SQL Database and populate a list view with each item the user adds. I chose SQL database because I want the data to…
Dodi
  • 2,201
  • 4
  • 30
  • 39
2
votes
1 answer

Select a set of rows and UPDATE or REMOVE some: SqlDataReader or SqlDataAdapter+DataSet

I am new to ADO.net I need to retrieve from DB a set of rows, then iterate one-be-one and send them, conditionally, to some objects which may UPDATE or DELETE received row from DB. From SqlDataReader documentation I didn't understand properly how…
ALZ
  • 1,997
  • 2
  • 27
  • 44
2
votes
1 answer

Dataadaptor returns no values and no exception

i am extreamly stuck from morning can someone help me i have a sql data adaptor which is not returning any values . In the same page in the top i have a SQldataadaptor which works fine . I do not know what to do . The query is working fine in the…
user2177370
  • 33
  • 1
  • 2
  • 7