How to insert data from the gridview in to the database?

I have represented data into gridview's one column,into another column i put a textbox for accepting user's data in each row.Now i want to input all data from both columns in to the database.Can u tell me how to do.Code is appreciated?
<asp:GridView ID="GridView1" runat="server"  Style="z-index: 102; left: 22px; position: absolute;top: 21px" Width="407px" AutoGenerateColumns="false" Height="176px" OnRowCommand="GridView1_RowCommand" >
           <Columns>
         <asp:TemplateField>
            <ItemTemplate>
               <asp:DropDownList ID="ddlOrder" runat="server">
                        <asp:ListItem>View</asp:ListItem>
                        <asp:ListItem>Delete</asp:ListItem>
                        <asp:ListItem>Both</asp:ListItem>
                         </asp:DropDownList>&nbsp;
                          </ItemTemplate>
           </asp:TemplateField>
            <asp:BoundField DataField="controlvalue" HeaderText="FormFillerIds" >
              <ItemStyle BackColor="White" />
          </asp:BoundField>
                 <asp:TemplateField>
                 <ItemTemplate>
                  
                  <asp:Button ID="Button1" runat="server" Text="Insert" OnClick="Button1_Click" Width="70px" Height="30px" />
            
                 </ItemTemplate>
                 </asp:TemplateField>
         </Columns>
              
        </asp:GridView>

Open in new window

LVL 2
tryokaneAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jorge PaulinoIT Pro/DeveloperCommented:
Check if this is enough for you http://forums.asp.net/p/1210560/2131957.aspx
0
tryokaneAuthor Commented:
Can we insert the data in the gridview row command.How to do?
0
Jorge PaulinoIT Pro/DeveloperCommented:
Yes, using the edit, update and delete but add i don't know ... Normally the gridview is bind to some datasource and you add data to the data source and then refresh the gridview.

Can you explain better what you want ?

Check this video helps http://www.asp.net/learn/videos/video-07.aspx
Or this link (it has very good starting manuals) http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/data/gridview.aspx
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

tryokaneAuthor Commented:
what i want is i want to insert the data from each row in to database.I am placing an insert button in each row.I want to insert each row in to the database on clicking the button.Can we use gridview row command for this insertion.If so can u tell me how?
0
Jorge PaulinoIT Pro/DeveloperCommented:
Not in the gridview. Is't not like winforms datagridview that you can add, change, delete, update.

You can use a DetailsView to do that. Check in this link in the end (last two example) http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/data/detailsview.aspx

Again the easy way is to add some textboxes and a button to insert and after the insert just bind the gridview for refresh the itens.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tryokaneAuthor Commented:
Thanks for ur response.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.