Adding data into GridView
-
I grabbed the gridview control onto design page and then binded it with the database. Now I want to enter data in the grid view when i run the website but i cannot find the way to do that. How can this be done? Any guidance please or show me the code or way to do that. Thanks :confused:
-
I grabbed the gridview control onto design page and then binded it with the database. Now I want to enter data in the grid view when i run the website but i cannot find the way to do that. How can this be done? Any guidance please or show me the code or way to do that. Thanks :confused:
-
Be more clear, you mean, that your gridview read well the data from the database, but you can't add new records? did you bind the gridwiew to a sqlDataSource?
yes i can see the data which has been added from SQL Server DB but how I can add manually? Yes I binded gridview to SQL Data Source.
-
yes i can see the data which has been added from SQL Server DB but how I can add manually? Yes I binded gridview to SQL Data Source.
ok, when you bind the sqlDatasource. if you want enable edit and adding, you have to make when you are configuring the sqldatasource, in the box you select the columns you want to show from the database, there are three botton, Where, orden by and Advanced click the last one, Advanced, and check the first box "generate inset up........ and bind again your grid view to the sqldatasource. and play with the grid view setting to make enable edit and adding. hope that will help
-
ok, when you bind the sqlDatasource. if you want enable edit and adding, you have to make when you are configuring the sqldatasource, in the box you select the columns you want to show from the database, there are three botton, Where, orden by and Advanced click the last one, Advanced, and check the first box "generate inset up........ and bind again your grid view to the sqldatasource. and play with the grid view setting to make enable edit and adding. hope that will help
I can see edit option but no ADD option. How can this be done?
-
I can see edit option but no ADD option. How can this be done?
check out this videos, they will help you a lot to do what you want to do, the are in asp.net official website [http://www.asp.net/learn/videos/default.aspx?tabid=63#ajax](<a href=)[^]" rel="nofollow">http://www.asp.net/learn/videos/default.aspx?tabid=63#ajax[^][[http://www.asp.net/learn/videos/default.aspx?tabid=63#ajax](<a href= "New Window")[^]">^]