问题
I am creating a web site using Visual Web Developer 2010. I currently have a datasource that gets its information from the Access database that has been added into the APP_Data section. 1) How would I run a query by using a button that been placed on the website.
2) How would I display the result of that query into a datagridview or some other data control?
回答1:
You can add a gridview to the form and then configure the access data source to use a where clause to select rows. Then just choose the textbox control you want to get the value from and add a button to do a post-back, which will run the query.
If you need more help with this let me know, I've got a working sample.
来源:https://stackoverflow.com/questions/3569565/visual-web-developer-sql-query-via-button