hi Can any one help me for my query. In sample table we are having just 2 or 3 columns, so we can added text box for that columns and whatever changes we can do through that text box. but in real time project we are having a N number of column so we can not keep text box for that many columns in visual studio 2010. So Please can you help me "HOW TO INSERT, DELETE and UPDATE a record directly in grid view and that will appear on database simultaneously".
I am waiting for your reply

sujitha m15 reputationPosted Aug 18, 2017, 12:40 AM EDT
sujitha m15 reputationPosted Aug 18, 2017, 1:42 AM EDT
Gokhul VarmanRank #1,505 · 1.1K reputationPosted Aug 18, 2017, 12:22 AM EDT
Manikandan MurugesanRank #300 · 8.4K reputationPosted Aug 18, 2017, 1:28 AM EDT
Manikandan MurugesanRank #300 · 8.4K reputationPosted Aug 18, 2017, 1:51 AM EDT
Krishna Rajput SinghRank #605 · 4K reputationPosted Aug 18, 2017, 2:04 AM EDT
sujitha m15 reputationPosted Aug 18, 2017, 3:46 AM EDT
Krishna Rajput SinghRank #605 · 4K reputationPosted Aug 19, 2017, 3:38 AM EDT
Amit GuptaRank #190 · 12.8K reputationPosted Aug 19, 2017, 9:10 AM EDT
Guest User143 reputationPosted Sep 17, 2017, 12:48 AM EDT
Hi
Inserting Records into a Table
There are essentially two methods for adding records to a table. The first is to add one record at a time; the second is to add many records at a time. In both cases, you use the SQL statement INSERT INTO to accomplish the task. INSERT INTO statements are commonly referred to as append queries.
To add one record to a table, you must use the field list to define which fields to put the data in, and then you must supply the data itself in a value list. To define the value list, use the VALUES clause. For example, the following statement will insert the values "1", "Kelly", and "Jill" into the CustomerID, Last Name, and First Name fields, respectively.
You can omit the field list, but only if you supply all the values that record can contain.
To add many records to a table at one time, use the INSERT INTO statement along with a SELECT statement. When you are inserting records from another table, each value being inserted must be compatible with the type of field that will be receiving the data.
The following INSERT INTO statement inserts all the values in the CustomerID, Last Name, and First Name fields from the tblOldCustomers table into the corresponding fields in the tblCustomers table.
INSERT INTO tblCustomers (CustomerID, [Last Name], [First Name]) SELECT CustomerID, [Last Name], [First Name] FROM tblOldCustomersIf the tables are defined exactly alike, you can leave out the field lists.
Updating Records in a Table
To modify the data that is currently in a table, you use the UPDATE statement, which is commonly referred to as an update query. The UPDATE statement can modify one or more records and generally takes this form:
To update all the records in a table, specify the table name, and then use the SET clause to specify the field or fields to be changed.
In most cases, you will want to qualify the UPDATE statement with a WHERE clause to limit the number of records changed.
UPDATE tblCustomers SET Email = 'None' WHERE [Last Name] = 'Smith'Deleting Records from a Table
To delete the data that is currently in a table, you use the DELETE statement, which is commonly referred to as a delete query. This is also known as truncating a table. The DELETE statement can remove one or more records from a table and generally takes this form:
The DELETE statement does not remove the table structure—only the data that is currently being held by the table structure. To remove all the records from a table, use the DELETE statement and specify which table or tables from which you want to delete all the records.
In most cases, you will want to qualify the DELETE statement with a WHERE clause to limit the number of records to be removed.
If you want to remove data only from certain fields in a table, use the UPDATE statement and set those fields equal to NULL, but only if they are nullable fields.
Bharathi RajaRank #1,777 · 842 reputationPosted Jan 30, 2018, 11:52 PM EST
Mageshwaran RRank #411 · 6.1K reputationPosted Nov 22, 2019, 7:15 AM EST