Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想开发应用程序,其中用户在单击提交按钮时将查询写入文本框,它仅在我使用 VS 2008 的 Sql Server 查询分析器工具中显示网格中的结果,并在 Asp.Net 中使用C#。谢谢
这取决于您想要拥有它的高级程度。大多数场景只需要一个可以编写 sql 语句的文本框、一个提交它的按钮和一个带有 AutoGenerateColumns="true"(默认值)的 GridView 控件来显示请求的数据就足够了。在代码隐藏中,您只需从文本框中获取字符串,将其用作内联 sql 语句并使用简单的 ADO.NET 连接数据库并将结果绑定到 GridView。