sql - Binding a database view to a c# .net gridview -


i have been using excel view database tables binding sql database views in excel , making spreadsheet. works fine want solution in code.

is there way in c# asp.net bind database view directly gridview when given view name string?

***solved*****

i did more research , found solution. main issue didn't want have make business objects or have stored procedure on database.

the solution found use sqldatasource. set sqldatasource.connectionstring , set sqldatasource.selectcommand "select * from" +myviewname , bind datasource gridview.

using method have pass in table/view name , gridview populated database directly. allows me use same code , thing needs changing database view name string.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -