Click here to Skip to main content
15,437,409 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to create a class to perform CRUD operations in a SQL Server Database Table.

I want to be able to Create, Update, or Delete a single row of data in a Table. I have no problem retrieving a single row of data, or multiple rows of data from a table, using the SQL Data Reader. I have spent several hours searching Microsoft help files for examples of how to do this. The MS Help examples all refer to Adding or updating multiple rows at a time, using a Data Adapter. Creating the SQL Query is no problem. Using it with a Data Adapter, or a Data Set, is.

An example of how to retrieve a row of data, modify one or more of the columns, and update that row is what I really need. If you can help, I would appreciate it.
I'm using VisualStudio 2022, and SQJ Server version 15.0.2080

I don't understand how to do that with a Data Adapter, or a Data Set.

What I have tried:

Using various examples from the MS help files, including using a Data adapter to execute a Stored Procedure. Unable to make any of them work. :(
Posted
Updated 1-Apr-22 2:07am
v2

1 solution

Try the SQL Command and associated command structure

SQL Syntax[^][^]
 
Share this answer
 
v2
Comments
Slow Eddie 1-Apr-22 7:42am    
Thank you, Mike for your reply. I am sorry for not being more specific. I am able to write Sql queries, and have done so for years. My problem is with the Data Adapter, and Data Sets. I find the Help files to be incomprehensible.
Mike Hankey 1-Apr-22 7:52am    
Not a problem, I had a problem early on grappling with ADO and bought ADO.NET in a Nutshell book by Matthew MacDonald[^] this book. I very rarely find uSoft docs useful
Slow Eddie 1-Apr-22 8:09am     CRLF
Cool! I'll give it a try. Also, I have updated my question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900