How to Bind a GridView from database

前端 未结 6 2057
梦谈多话
梦谈多话 2020-12-11 19:24

How to bind a GridView?

I want to display my table data in a gridview.

I have createed SQL table EmpDetail with columns ID, Name, Salary D

6条回答
  •  一生所求
    2020-12-11 20:20

    You could simply use the SqlDataSource. You would move the SqlDataSource from the toolbox where it says Data, SqlDataSource. You would then configure the datasource using the smart tag. Then using the smart tag on the gridview, select the SqlDataSource you placed onto the aspx page. This is really quick and requires little to no coding. http://msdn.microsoft.com/En-us/Library/z72eefad.aspx this will show you a little bit more. Hope this helps you!

提交回复
热议问题