Click here to Skip to main content
15,851,701 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi friends,

i want to insert data into database by using gridview...
Updated 11-Jun-10 5:23am

A gridview does not insert data anywhere, it shows it. Instead, you need to write a database layer, which uses SQL to insert any changes or additions to your gridview.
Share this answer
suhailshai wrote:
insert data into database by using gridview

As CG told, you dont use gridview to insert data, probably you are talking of inserting data that is being shown using a gridview.
Look here:
MSDN: How to update a database from a DataSet object by using Visual Basic .NET[^]
MSDN: How To Update a SQL Server Database by Using the SqlDataAdapter Object in Visual C# .NET[^]
Share this answer
You don't really have a question. But I'll take a stab at guessing what you are asking and suggest you create a footer template in your grid view to hold the "new" row of data that will be inserted. You can then have some event (e.g., a button click) save that data to the database.
Share this answer

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