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

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -