动态数据网格未显示 [英] Dynamic Datagrid not showing up
问题描述
大家好,
提前感谢您试图帮助我。
我有一个运行动态生成的SQLDataSource SQL2005存储过程。 (也就是说,存储过程创建一个varchar字符串,并以exec(@string)命令结束。)gridview使用数据源来显示结果。存储过程获得许多参数,这些参数设置使用查询标准1的比特值。 ,使用查询标准2,等等都绑定到Visual Studio复选框。 (结果是 - 将 - 用户可以选择一个或多个复选框并过滤返回的记录。)
当我执行它时,存储过程运行完美数据库方面,以及当我点击测试查询时在SQLDataSource配置向导中。列设置正确,一切看起来都很好,直到我构建它。
我的问题是gridview只是没有出现。没有标题,没有数据 - 没什么。
我承认我非常困惑。有没有人知道是什么原因引起的?
其他可能有用的信息:
我没有得到任何构建错误或SQL异常。
如果不是用exec(@string)结束存储过程,而是使用SELECT @string,并将输出复制/粘贴到数据源的Select语句中,它运行正常。
此外,单步执行.cs文件表明从不调用SqlDataSource_Selected()。知道为什么会这样吗?
提前感谢您的帮助!
Hi everyone,
Thanks in advance for trying to help me out.
I have a SQLDataSource which is running a dynamically generated SQL2005 stored procedure. (That is, the stored procedure creates a varchar string and ends with an exec(@string) command.) The datasource is used by a gridview to display the result. The stored procedure gets a number of parameters which set bit values for "use query criteria 1" , "use query criteria 2" etc which are all tied to Visual Studio check boxes. (The result is-- will be-- that the user can select one or more check boxes and filter which records are returned.)
The stored procedure runs perfectly when I execute it on the database side, as well as when I click "Test Query" in the SQLDataSource configuration wizard. The columns are set properly, and everything looks to be fine right up until when I build it.
My problem is the gridview just doesn''t show up. No header, no data-- nothing.
I admit I''m very perplexed. Does anyone have any idea what could cause this?
Other potentially useful info:
I don''t get any build errors or SQL exceptions.
If instead of ending the stored procedure with exec(@string) I use SELECT @string, and copy/paste the output into the Select statement of the datasource, it runs fine.
Also, stepping through the .cs file shows that the SqlDataSource_Selected() is never called. Any idea why this would be?
Thanks in advance for your help!
推荐答案
您能否发布您的代码SQLDataSource,以便我们可以看到发生了什么?
谢谢,
-Frinny
Could you please post your code for the SQLDataSource so that we can see what''s going on?
Thanks,
-Frinny
肯定的事Frinny。
SQLDataSource使用这段代码:
Sure thing Frinny.
The SQLDataSource uses this code:
这不是我所期待的。
你不是说你测试了你的存储过程它运行正常吗?
或者你的存储过程无法正常工作?
我期待看到C#代码...
This wasn''t what I was expecting.
Didn''t you say that you tested your stored procedure and it worked fine?
Or is your stored procedure not working?
I was expecting to see C# code...
>
这篇关于动态数据网格未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!