机密数据绑定到DropDown框的问题 [英] Problems wit Databinding to a DropDown box

查看:84
本文介绍了机密数据绑定到DropDown框的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我已完成以下操作将数据绑定到DropDown框:


1.将SQLServer表拖到Web表单上创建数据连接和数据

适配器。


2.右键单击数据适配器广告生成数据集

生成数据集。


3.设置下拉框属性以反映:


Datasource = Dataset11

Datamember = table

Datatextfield = tablerow

Datavaluefield = tablerow


当我运行应用程序时,我不生成任何错误,但没有数据在DropDown框中显示
......好吧,实际上我得到了一个下拉状态

空白。


任何想法都是Imay做错了什么?


另外,如果我对信息进行编码,我可以把它放在CodeBehind文件中还是

它必须在实际的ASPX中吗?


提前谢谢,

Kris

解决方案

您是否调用了DropDown框的.DataBind方法?

" Kris Rockwell" < KR *************************** @ hybrid-learning.com>写在

消息新闻:Od ************** @ TK2MSFTNGP09.phx.gbl ...

你好,
我已完成以下操作将数据绑定到DropDown框:

1.将SQLServer表拖到Web表单上以创建数据连接和数据
适配器。

2.通过右键单击数据适配器广告选择生成数据集来生成数据集。

3.设置下拉框属性以反映:

Datasource = Dataset11
Datamember = table
Datatextfield = tablerow
Datavaluefield = tablerow

当我运行应用程序时,我不会产生任何错误,但DropDown框中没有数据......好吧,实际上我得到了一个空白的下拉菜单。

任何想法都是Imay做错了吗?另外,如果我对信息进行编码,我可以把它放在CodeBehind文件中吗?
它是否必须在实际的ASPX中?

提前致谢,
Kris


我没有在代码中明确地调用它,但是我已经在DropDown Box的

属性页面中设置了它。


我确实尝试了但仍然没有结果。这很奇怪,但是...

框似乎填充了我可以放下它,但没有内容,因为

应该有。


Kris

" Scott M." < S - *** @ BADSPAMsnet.net>在消息中写道

新闻:#K ************** @ TK2MSFTNGP09.phx.gbl ...

你有没有打电话给DropDown框的.DataBind方法?

" Kris Rockwell" < KR *************************** @ hybrid-learning.com>在消息新闻中写了
:Od ************** @ TK2MSFTNGP09.phx.gbl ...

你好,

我已完成以下操作将数据绑定到DropDown框:

1.将SQLServer表拖到Web表单上以创建数据连接和数据

2.通过右键单击数据适配器广告选择生成数据集来生成数据集。

3.设置下拉框属性以反映:

Datasource = Dataset11
Datamember = table
Datatextfield = tablerow
Datavaluefield = tablerow

当我运行应用程序时,我不会产生任何错误,但没有数据是
出现在DropDown框中......好吧,实际上我得到了一个空白的下拉菜单。

任何想法都是Imay做错了吗?
<另外,如果我对信息进行编码,我可以把它放在CodeBehind文件中,或者


它必须在实际的ASPX中吗?

谢谢提前,
Kris




你不能调用DataBind方法(或通过设计时属性框,任何对象的任何方法

问题。必须从代码中调用它。

这个盒子下降的事实就是注意到了所有下拉盒子里面没有数据的东西。


让我们看看你的整个Page_Load事件处理程序。

" Kris Rockwell" < KR *************************** @ hybrid-learning.com>写在

消息新闻:eD ************** @ TK2MSFTNGP12.phx.gbl ...

我还没有在代码中明确地调用了它,但是我已经在DropDown Box的
属性页面中设置了它。

我确实尝试了它但仍然没有结果。虽然很奇怪......
框似乎填充了我可以放下它,但没有内容,因为它应该有。

Kris
" Scott M." < S - *** @ BADSPAMsnet.net>在消息中写道
新闻:#K ************** @ TK2MSFTNGP09.phx.gbl ...

你有没有调用.DataBind方法DropDown框?

" Kris Rockwell" < KR *************************** @ hybrid-learning.com>

消息新闻中写了

:Od ************** @ TK2MSFTNGP09.phx.gbl ... < blockquote class =post_quotes>您好,

我已完成以下操作将数据绑定到DropDown框:

1.将SQLServer表拖到Web表单上以创建数据连接和
数据适配器。

2.通过右键单击数据适配器广告选择生成数据集来生成数据集。

3.设置丢弃down box属性反映如此:

Datasource = Dataset11
Datamember = table
Datatextfield = tablerow
Datavaluefield = tablerow

当我运行应用程序我没有产生任何错误,但DropDown框中没有数据......好吧,实际上我得到一个空白的下拉菜单。

任何想法是Imay做错了什么?

另外,如果我对信息进行编码,我可以将它放在CodeBehind文件中


或者

它必须在实际的ASPX中吗?

提前致谢,
Kris





Hello,

I have done the following to bind data to a DropDown box:

1. Drag SQLServer table onto web form to create data connection and data
adapter.

2. Generate dataset by right-clicking on the data adapter ad selecting
generate dataset.

3. Setting the drop down box propertied to reflect so that:

Datasource = Dataset11
Datamember = table
Datatextfield = tablerow
Datavaluefield = tablerow

When I run the application I don''t generate any errors, but no data is
present in the DropDown box...Well, actually I get a drop down that is
blank.

Any ideas an what Imay be doing wrong?

Also, if I code the information, can I put it in the CodeBehind file or does
it have to be in the actual ASPX?

Thanks in advance,
Kris

解决方案

Did you call the .DataBind method of the DropDown box?
"Kris Rockwell" <kr***************************@hybrid-learning.com> wrote in
message news:Od**************@TK2MSFTNGP09.phx.gbl...

Hello,

I have done the following to bind data to a DropDown box:

1. Drag SQLServer table onto web form to create data connection and data
adapter.

2. Generate dataset by right-clicking on the data adapter ad selecting
generate dataset.

3. Setting the drop down box propertied to reflect so that:

Datasource = Dataset11
Datamember = table
Datatextfield = tablerow
Datavaluefield = tablerow

When I run the application I don''t generate any errors, but no data is
present in the DropDown box...Well, actually I get a drop down that is
blank.

Any ideas an what Imay be doing wrong?

Also, if I code the information, can I put it in the CodeBehind file or does it have to be in the actual ASPX?

Thanks in advance,
Kris



I haven''t explicitly called it in the code, but I have set it in the
Property page of the DropDown Box.

I did try it though and still got no results. It is strange, though...The
box seems populated in that I can drop it down, but there is no content as
there should be.

Kris
"Scott M." <s-***@BADSPAMsnet.net> wrote in message
news:#K**************@TK2MSFTNGP09.phx.gbl...

Did you call the .DataBind method of the DropDown box?
"Kris Rockwell" <kr***************************@hybrid-learning.com> wrote in message news:Od**************@TK2MSFTNGP09.phx.gbl...

Hello,

I have done the following to bind data to a DropDown box:

1. Drag SQLServer table onto web form to create data connection and data
adapter.

2. Generate dataset by right-clicking on the data adapter ad selecting
generate dataset.

3. Setting the drop down box propertied to reflect so that:

Datasource = Dataset11
Datamember = table
Datatextfield = tablerow
Datavaluefield = tablerow

When I run the application I don''t generate any errors, but no data is
present in the DropDown box...Well, actually I get a drop down that is
blank.

Any ideas an what Imay be doing wrong?

Also, if I code the information, can I put it in the CodeBehind file or


does

it have to be in the actual ASPX?

Thanks in advance,
Kris




You can''t call the DataBind method (or any method of any object for that
matter) via the design-time property box. It must be called from code. The
fact that the box drops down with noting in it is what all drop down boxes
that don''t have data in them do.

Let''s see your entire Page_Load event handler.
"Kris Rockwell" <kr***************************@hybrid-learning.com> wrote in
message news:eD**************@TK2MSFTNGP12.phx.gbl...

I haven''t explicitly called it in the code, but I have set it in the
Property page of the DropDown Box.

I did try it though and still got no results. It is strange, though...The
box seems populated in that I can drop it down, but there is no content as
there should be.

Kris
"Scott M." <s-***@BADSPAMsnet.net> wrote in message
news:#K**************@TK2MSFTNGP09.phx.gbl...

Did you call the .DataBind method of the DropDown box?
"Kris Rockwell" <kr***************************@hybrid-learning.com> wrote

in

message news:Od**************@TK2MSFTNGP09.phx.gbl...

Hello,

I have done the following to bind data to a DropDown box:

1. Drag SQLServer table onto web form to create data connection and data adapter.

2. Generate dataset by right-clicking on the data adapter ad selecting
generate dataset.

3. Setting the drop down box propertied to reflect so that:

Datasource = Dataset11
Datamember = table
Datatextfield = tablerow
Datavaluefield = tablerow

When I run the application I don''t generate any errors, but no data is
present in the DropDown box...Well, actually I get a drop down that is
blank.

Any ideas an what Imay be doing wrong?

Also, if I code the information, can I put it in the CodeBehind file


or does

it have to be in the actual ASPX?

Thanks in advance,
Kris





这篇关于机密数据绑定到DropDown框的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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