网格视图显示问题 [英] Issue with Grid View Display

查看:95
本文介绍了网格视图显示问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在网格中显示存储过程的结果集时遇到问题.以下是我的代码详细信息:
存储的Proc返回3列和8行,我在调试时进行了验证,但是即使将EnableViewSet和Visible属性设置为"True",这些记录也不会显示.我将绑定部分放置在Button Click事件下,如下所示.执行时没有收到任何错误消息,

Hi,
I''m facing a problem in displaying a result set of a stored procedure in a grid. Below are my code details:
Stored Proc returns 3 columns and 8 rows which I verified while debugging but those records re not getting displayed even after i set EnableViewSet and Visible property as ''True''. I have placed the binding portion under the Button Click event as below.I didn''t get any error message when executing,

Dim cmd As New OracleCommand()
       Dim DA As New OracleDataAdapter(cmd)
       Dim DS As New DataTable
       Details_grd = New GridView
       cmd.Connection = con
       cmd.CommandType = CommandType.StoredProcedure
       cmd.CommandText = "Details_display"
       cmd.Parameters.Add(New OracleParameter("Services", OracleType.VarChar)).Value = RadioButtonList1.SelectedItem.Value
       cmd.Parameters.Add(New OracleParameter("result", OracleType.Cursor)).Direction = ParameterDirection.Output
       con.Open()
       DA.Fill(DS)
       Details_grd.DataSource = DS
       Details_grd.DataBind()
       con.Close()



任何人,请帮助我了解以上代码段中的缺失/错误部分.在此先感谢,

Priya



Anyone,pleas help me in understanding the missing/wrong portion in the above snippet.Thanks in advance,

Priya

推荐答案

Priya,

不知道它是否行得通.
删除Gridview对象的创建.
您可以从工具箱中手动下拉gridview
并将其绑定到数据源.
如果gridview的名称是gridview1,则
Priya,

Don''t know whether it would work.
remove the object Creation of the Gridview.
You can manually pull down a gridview from toolbox
and bind it to datasource.
if name of gridview is gridview1 then
gridview1.DataSource=dataset;
gridview1.DataBind();


毕竟可能是对象创建问题.
祝您编程愉快:-)


May be the object creation is the problem after all.
Happy Programming:-)


您的代码似乎可以在页面加载事件中尝试使用此代码.
检查它是否有效.
Your Code Seems Fine try this code in your page load event.
Check whether it works.


这篇关于网格视图显示问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆