473,396 Members | 2,093 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

automatic databinding?

I have an AccessDataSource control and a DataList control and databinding to
display the database results. Although there is no Page.DataBind() in my
codebehind code it obviously is there somewhere, do the controls do it or is
it by default done in the page building sequence?
How can I control my self if that particular control is to be databound or
not?
Nov 19 '05 #1
2 1379
Hi Davids
use yourDataList.DataBind()
"Davids" wrote:
I have an AccessDataSource control and a DataList control and databinding to
display the database results. Although there is no Page.DataBind() in my
codebehind code it obviously is there somewhere, do the controls do it or is
it by default done in the page building sequence?
How can I control my self if that particular control is to be databound or
not?

Nov 19 '05 #2
The DataSource controls provide the necessary logic to bind your controls on
each page load. If you want more control, wire up the Selecting event. This
event allows you to specify whether you want the DataSource control to bind
data or not on that particular page load. Here's an example:

Sub AccessDataSource1_Selecting(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.SqlDataSourceSelectingEv entArgs)
If DateTime.Now.DayOfWeek = DayOfWeek.Monday Then
e.Cancel = True
End If
End Sub

In this example, the AccessDataSource control named AccessDataSource1 will
only bind the data if it's Tuesday-Sunday.

Happy coding,
Johann MacDonagh

"Davids" <db****@simnet.is> wrote in message
news:co**********@news.simnet.is...
I have an AccessDataSource control and a DataList control and databinding
to display the database results. Although there is no Page.DataBind() in my
codebehind code it obviously is there somewhere, do the controls do it or
is it by default done in the page building sequence?
How can I control my self if that particular control is to be databound or
not?

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Kevin Swanson | last post by:
I'm writing what should be a very simple app against an Oracle database. The app has a number of user controls, any one of which is loaded into a main display page using the loadControl method,...
7
by: Ben R. | last post by:
How does automatic type casting happen in vb.net? I notice that databinder.eval "uses reflectoin" to find out the type it's dealing with. Does vb.net do the same thing behind the scenes when an...
8
by: Dirk | last post by:
Hello, I have a problem to use databinding with my business layer classes. My data class does not have simple properties (string, int or datetime), instead, all my properties are objects of the...
1
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hello to all, I want to know if DataBinding in asp.net 2,0 is better than to fill up the values of the controls of the following form: this.miControlTextBox.Text = valorParaControlTextbox; ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.