473,715 Members | 3,751 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

2.0 controlling Databinding

We have been noticing that questions on vs.2005/2.0 don't appear to get much
in answers so I'm reposting some questions posted by some of the programmers
here in our organization that never got answered...

In 1.1 we always did our own myDataAdapter.f ills and we liked that control
for lots of good reasons. Now the new DataSource (or is it a
TableAdapter:Da taset) automatically fills the Gridview. How can we control
that fill?

In a forms app there is a Form1.vb that has.....
Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load

'TODO: This line of code loads data into the
'NorthwindDataS et.Order_Detail s' table. You can move, or remove it, as
needed.

Me.Order_Detail sTableAdapter.F ill(Me.Northwin dDataSet.Order_ Details)

'TODO: This line of code loads data into the 'NorthwindDataS et.Orders'
table. You can move, or remove it, as needed.

Me.OrdersTableA dapter1.Fill(Me .NorthwindDataS et.Orders)

End Sub

Here we can remove or place the code where we want but we can't find that
opportunity in asp apps.
--
Regards,
Gary Blakely
Dec 31 '05 #1
8 2177
Hi Gary,

Welcome.
I've also seen your another thread in this group

Subject: 2.0 DataSources vs. TableAdapter/Datasets

and posted my response there. As I've mentioned there. In ASP.NET
application the page instances are not persisted in memory, each time a
request has been processed (finished..), the page instance and other
related resources will be disposed... So maintain a member dataset or
tableadpater is not quite usable as in winform form class.... If you do
need global object, you can create and store them in ApplciationStat e /
Cache (or session if user specific...), and then we can reference them in
other pages' code....

We can surely perform the same operation on those DataSet and TableAdapters
like in winform app. e.g:

taOD = Application("ta _order_details" )
dsOD = Application("ds _order_details" )

taOD.Fill(dsOD. Order_Details)

..............

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| From: "GaryDean" <Ga******@newsg roups.nospam>
| Subject: 2.0 controlling Databinding
| Date: Sat, 31 Dec 2005 14:23:37 -0800
| Lines: 33
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <e8************ **@TK2MSFTNGP14 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: user-vcaur7q.dsl.min dspring.com 216.175.108.250
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP14.phx. gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3678 81
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| We have been noticing that questions on vs.2005/2.0 don't appear to get
much
| in answers so I'm reposting some questions posted by some of the
programmers
| here in our organization that never got answered...
|
| In 1.1 we always did our own myDataAdapter.f ills and we liked that
control
| for lots of good reasons. Now the new DataSource (or is it a
| TableAdapter:Da taset) automatically fills the Gridview. How can we
control
| that fill?
|
| In a forms app there is a Form1.vb that has.....
| Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
| System.EventArg s) Handles MyBase.Load
|
| 'TODO: This line of code loads data into the
| 'NorthwindDataS et.Order_Detail s' table. You can move, or remove it, as
| needed.
|
| Me.Order_Detail sTableAdapter.F ill(Me.Northwin dDataSet.Order_ Details)
|
| 'TODO: This line of code loads data into the 'NorthwindDataS et.Orders'
| table. You can move, or remove it, as needed.
|
| Me.OrdersTableA dapter1.Fill(Me .NorthwindDataS et.Orders)
|
| End Sub
|
| Here we can remove or place the code where we want but we can't find that
| opportunity in asp apps.
| --
| Regards,
| Gary Blakely
|
|
|

Jan 3 '06 #2
let me be more specific.....

If I drop a GridView on an aspx page and then create a datasource for it and
then run the page, it will bind automatically.

I DON'T WANT IT TO BIND AUTOMATICALLY. I want it to bind when button1 is
pushed and not until.

How can I do that? In other words, how can I control my binding
automatically?

Thanks,
Gary

"Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
news:VE******** ********@TK2MSF TNGXA02.phx.gbl ...
Hi Gary,

Welcome.
I've also seen your another thread in this group

Subject: 2.0 DataSources vs. TableAdapter/Datasets

and posted my response there. As I've mentioned there. In ASP.NET
application the page instances are not persisted in memory, each time a
request has been processed (finished..), the page instance and other
related resources will be disposed... So maintain a member dataset or
tableadpater is not quite usable as in winform form class.... If you do
need global object, you can create and store them in ApplciationStat e /
Cache (or session if user specific...), and then we can reference them in
other pages' code....

We can surely perform the same operation on those DataSet and
TableAdapters
like in winform app. e.g:

taOD = Application("ta _order_details" )
dsOD = Application("ds _order_details" )

taOD.Fill(dsOD. Order_Details)

.............

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| From: "GaryDean" <Ga******@newsg roups.nospam>
| Subject: 2.0 controlling Databinding
| Date: Sat, 31 Dec 2005 14:23:37 -0800
| Lines: 33
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <e8************ **@TK2MSFTNGP14 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: user-vcaur7q.dsl.min dspring.com 216.175.108.250
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP14.phx. gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3678 81
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| We have been noticing that questions on vs.2005/2.0 don't appear to get
much
| in answers so I'm reposting some questions posted by some of the
programmers
| here in our organization that never got answered...
|
| In 1.1 we always did our own myDataAdapter.f ills and we liked that
control
| for lots of good reasons. Now the new DataSource (or is it a
| TableAdapter:Da taset) automatically fills the Gridview. How can we
control
| that fill?
|
| In a forms app there is a Form1.vb that has.....
| Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
| System.EventArg s) Handles MyBase.Load
|
| 'TODO: This line of code loads data into the
| 'NorthwindDataS et.Order_Detail s' table. You can move, or remove it, as
| needed.
|
| Me.Order_Detail sTableAdapter.F ill(Me.Northwin dDataSet.Order_ Details)
|
| 'TODO: This line of code loads data into the 'NorthwindDataS et.Orders'
| table. You can move, or remove it, as needed.
|
| Me.OrdersTableA dapter1.Fill(Me .NorthwindDataS et.Orders)
|
| End Sub
|
| Here we can remove or place the code where we want but we can't find
that
| opportunity in asp apps.
| --
| Regards,
| Gary Blakely
|
|
|

Jan 3 '06 #3
I mean "manually"

"GaryDean" <Ga******@newsg roups.nospam> wrote in message
news:%2******** *******@TK2MSFT NGP10.phx.gbl.. .
let me be more specific.....

If I drop a GridView on an aspx page and then create a datasource for it
and then run the page, it will bind automatically.

I DON'T WANT IT TO BIND AUTOMATICALLY. I want it to bind when button1 is
pushed and not until.

How can I do that? In other words, how can I control my binding
automatically?

Thanks,
Gary

"Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
news:VE******** ********@TK2MSF TNGXA02.phx.gbl ...
Hi Gary,

Welcome.
I've also seen your another thread in this group

Subject: 2.0 DataSources vs. TableAdapter/Datasets

and posted my response there. As I've mentioned there. In ASP.NET
application the page instances are not persisted in memory, each time a
request has been processed (finished..), the page instance and other
related resources will be disposed... So maintain a member dataset or
tableadpater is not quite usable as in winform form class.... If you do
need global object, you can create and store them in ApplciationStat e /
Cache (or session if user specific...), and then we can reference them
in
other pages' code....

We can surely perform the same operation on those DataSet and
TableAdapters
like in winform app. e.g:

taOD = Application("ta _order_details" )
dsOD = Application("ds _order_details" )

taOD.Fill(dsOD. Order_Details)

.............

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| From: "GaryDean" <Ga******@newsg roups.nospam>
| Subject: 2.0 controlling Databinding
| Date: Sat, 31 Dec 2005 14:23:37 -0800
| Lines: 33
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <e8************ **@TK2MSFTNGP14 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: user-vcaur7q.dsl.min dspring.com 216.175.108.250
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP14.phx. gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3678 81
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| We have been noticing that questions on vs.2005/2.0 don't appear to get
much
| in answers so I'm reposting some questions posted by some of the
programmers
| here in our organization that never got answered...
|
| In 1.1 we always did our own myDataAdapter.f ills and we liked that
control
| for lots of good reasons. Now the new DataSource (or is it a
| TableAdapter:Da taset) automatically fills the Gridview. How can we
control
| that fill?
|
| In a forms app there is a Form1.vb that has.....
| Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
| System.EventArg s) Handles MyBase.Load
|
| 'TODO: This line of code loads data into the
| 'NorthwindDataS et.Order_Detail s' table. You can move, or remove it, as
| needed.
|
| Me.Order_Detail sTableAdapter.F ill(Me.Northwin dDataSet.Order_ Details)
|
| 'TODO: This line of code loads data into the 'NorthwindDataS et.Orders'
| table. You can move, or remove it, as needed.
|
| Me.OrdersTableA dapter1.Fill(Me .NorthwindDataS et.Orders)
|
| End Sub
|
| Here we can remove or place the code where we want but we can't find
that
| opportunity in asp apps.
| --
| Regards,
| Gary Blakely
|
|
|


Jan 3 '06 #4
Hi Gary,

DataBound control automatically retrieve datas from the DataSource control
is because you assign the DataSourceID of the databound control at
design-time, and the asp.net 2.0 databound controls will automatically do
the databinding when the DataSourceID is configured... Also, this
automatic databinding is performed during the PreRender event......

If you do not want such automatic databinding, you can consider either of
the following means:

1. Assign the DataSourceID at runtime (in a certain of your control's
postback event) and call databind method....

2. Call DataSourceContr ol.Select method to get the IEnumerable collection
(datasource object) and assign it to DataBoundContro l.DataSource property
and call databind method....

Here is a simple test page which have three buttons, two of them use the
above two means and another used for clear the databinding:

=============== =============
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitl ed Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
ConnectionStrin g="<%$ ConnectionStrin gs:LocalNorthWi nd %>"
SelectCommand=" SELECT [CategoryID], [CategoryName],
[Description] FROM [Categories]">
</asp:SqlDataSour ce>
<asp:Button ID="btnDetach" runat="server" OnClick="btnDet ach_Click"
Text="Detach" />
<asp:Button ID="btnBindDS" runat="server" OnClick="btnBin dDS_Click"
Text="Bind DataSource Object" />
<asp:Button ID="btnBindDSC " runat="server"
OnClick="btnBin dDSC_Click" Text="BindDataS ourceControl" />
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>

</div>
</form>
</body>
=============== =============== ===============
public partial class GridView_GridVi ewPage : System.Web.UI.P age
{
protected void Page_Load(objec t sender, EventArgs e)
{

}
protected void btnDetach_Click (object sender, EventArgs e)
{
GridView1.DataS ourceID = string.Empty;
GridView1.DataS ource = null;
GridView1.DataB ind();
}
protected void btnBindDS_Click (object sender, EventArgs e)
{
GridView1.DataS ourceID = string.Empty;
GridView1.DataS ource =
SqlDataSource1. Select(DataSour ceSelectArgumen ts.Empty);

GridView1.DataB ind();
}
protected void btnBindDSC_Clic k(object sender, EventArgs e)
{
GridView1.DataS ource = null;
GridView1.DataS ourceID = "SqlDataSource1 ";
GridView1.DataB ind();
}
}
=============== ===========

So ASP.NET 2.0 provide both ondemand or automatic (declarative means)
databinding... And usually the IDE design-time will help do most of the
work, however when we need advanced functions or more flexible design, we
can still add our code to do it whatever means we like....

Hope helps. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "GaryDean" <Ga******@newsg roups.nospam>
| References: <e8************ **@TK2MSFTNGP14 .phx.gbl>
<VE************ **@TK2MSFTNGXA0 2.phx.gbl>
| Subject: Re: 2.0 controlling Databinding
| Date: Tue, 3 Jan 2006 10:02:58 -0800
| Lines: 114
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <#K************ *@TK2MSFTNGP10. phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: user-vcauk40.dsl.min dspring.com 216.175.80.128
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP10.phx. gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3683 22
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| let me be more specific.....
|
| If I drop a GridView on an aspx page and then create a datasource for it
and
| then run the page, it will bind automatically.
|
| I DON'T WANT IT TO BIND AUTOMATICALLY. I want it to bind when button1 is
| pushed and not until.
|
| How can I do that? In other words, how can I control my binding
| automatically?
|
| Thanks,
| Gary
|
| "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
| news:VE******** ********@TK2MSF TNGXA02.phx.gbl ...
| > Hi Gary,
| >
| > Welcome.
| > I've also seen your another thread in this group
| >
| > Subject: 2.0 DataSources vs. TableAdapter/Datasets
| >
| > and posted my response there. As I've mentioned there. In ASP.NET
| > application the page instances are not persisted in memory, each time a
| > request has been processed (finished..), the page instance and other
| > related resources will be disposed... So maintain a member dataset or
| > tableadpater is not quite usable as in winform form class.... If you
do
| > need global object, you can create and store them in ApplciationStat e /
| > Cache (or session if user specific...), and then we can reference them
in
| > other pages' code....
| >
| > We can surely perform the same operation on those DataSet and
| > TableAdapters
| > like in winform app. e.g:
| >
| > taOD = Application("ta _order_details" )
| > dsOD = Application("ds _order_details" )
| >
| > taOD.Fill(dsOD. Order_Details)
| >
| > .............
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| >
| > --------------------
| > | From: "GaryDean" <Ga******@newsg roups.nospam>
| > | Subject: 2.0 controlling Databinding
| > | Date: Sat, 31 Dec 2005 14:23:37 -0800
| > | Lines: 33
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| > | X-RFC2646: Format=Flowed; Original
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| > | Message-ID: <e8************ **@TK2MSFTNGP14 .phx.gbl>
| > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | NNTP-Posting-Host: user-vcaur7q.dsl.min dspring.com 216.175.108.250
| > | Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP14.phx. gbl
| > | Xref: TK2MSFTNGXA02.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:3678 81
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| > |
| > | We have been noticing that questions on vs.2005/2.0 don't appear to
get
| > much
| > | in answers so I'm reposting some questions posted by some of the
| > programmers
| > | here in our organization that never got answered...
| > |
| > | In 1.1 we always did our own myDataAdapter.f ills and we liked that
| > control
| > | for lots of good reasons. Now the new DataSource (or is it a
| > | TableAdapter:Da taset) automatically fills the Gridview. How can we
| > control
| > | that fill?
| > |
| > | In a forms app there is a Form1.vb that has.....
| > | Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
| > | System.EventArg s) Handles MyBase.Load
| > |
| > | 'TODO: This line of code loads data into the
| > | 'NorthwindDataS et.Order_Detail s' table. You can move, or remove it, as
| > | needed.
| > |
| > | Me.Order_Detail sTableAdapter.F ill(Me.Northwin dDataSet.Order_ Details)
| > |
| > | 'TODO: This line of code loads data into the 'NorthwindDataS et.Orders'
| > | table. You can move, or remove it, as needed.
| > |
| > | Me.OrdersTableA dapter1.Fill(Me .NorthwindDataS et.Orders)
| > |
| > | End Sub
| > |
| > | Here we can remove or place the code where we want but we can't find
| > that
| > | opportunity in asp apps.
| > | --
| > | Regards,
| > | Gary Blakely
| > |
| > |
| > |
| >
|
|
|

Jan 4 '06 #5
Steven,
What you say works ok but it does not provide the control we had with the
old dataGrid and Dataset...

With the datagrid I could add and edit columns at design time from a dataset
(maybe just a template dataset). I could apply edits to dates i.e. {0:d},
provide custom headings, etc. The dataset remained assigned but no fill
was done.

At run time I could do the fill on a button click event and my grid would
appear with all custom headings and edits in place. However in 2.0 if I do
all of those custom headings and edits at design time and then remove the
datasourceID I get a dialog box that says all columns will be removed and
therefore all of my edits and headings.

Being able to control the .fill in 1.1 gave us control at a lower level of
granularity than we have now. BTW, I see that I can control the fill in
Forms apps still in 2.0 as the .fills are done in the form1.vb file and I
can move those anywhere I want.

Is there anyway to control the timing of just the fill in asp?
--
Regards,
Gary Blakely
"Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
news:I8******** ******@TK2MSFTN GXA02.phx.gbl.. .
Hi Gary,

DataBound control automatically retrieve datas from the DataSource control
is because you assign the DataSourceID of the databound control at
design-time, and the asp.net 2.0 databound controls will automatically do
the databinding when the DataSourceID is configured... Also, this
automatic databinding is performed during the PreRender event......

If you do not want such automatic databinding, you can consider either of
the following means:

1. Assign the DataSourceID at runtime (in a certain of your control's
postback event) and call databind method....

2. Call DataSourceContr ol.Select method to get the IEnumerable collection
(datasource object) and assign it to DataBoundContro l.DataSource property
and call databind method....

Here is a simple test page which have three buttons, two of them use the
above two means and another used for clear the databinding:

=============== =============
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitl ed Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
ConnectionStrin g="<%$ ConnectionStrin gs:LocalNorthWi nd %>"
SelectCommand=" SELECT [CategoryID], [CategoryName],
[Description] FROM [Categories]">
</asp:SqlDataSour ce>
<asp:Button ID="btnDetach" runat="server" OnClick="btnDet ach_Click"
Text="Detach" />
<asp:Button ID="btnBindDS" runat="server" OnClick="btnBin dDS_Click"
Text="Bind DataSource Object" />
<asp:Button ID="btnBindDSC " runat="server"
OnClick="btnBin dDSC_Click" Text="BindDataS ourceControl" />
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>

</div>
</form>
</body>
=============== =============== ===============
public partial class GridView_GridVi ewPage : System.Web.UI.P age
{
protected void Page_Load(objec t sender, EventArgs e)
{

}
protected void btnDetach_Click (object sender, EventArgs e)
{
GridView1.DataS ourceID = string.Empty;
GridView1.DataS ource = null;
GridView1.DataB ind();
}
protected void btnBindDS_Click (object sender, EventArgs e)
{
GridView1.DataS ourceID = string.Empty;
GridView1.DataS ource =
SqlDataSource1. Select(DataSour ceSelectArgumen ts.Empty);

GridView1.DataB ind();
}
protected void btnBindDSC_Clic k(object sender, EventArgs e)
{
GridView1.DataS ource = null;
GridView1.DataS ourceID = "SqlDataSource1 ";
GridView1.DataB ind();
}
}
=============== ===========

So ASP.NET 2.0 provide both ondemand or automatic (declarative means)
databinding... And usually the IDE design-time will help do most of the
work, however when we need advanced functions or more flexible design, we
can still add our code to do it whatever means we like....

Hope helps. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "GaryDean" <Ga******@newsg roups.nospam>
| References: <e8************ **@TK2MSFTNGP14 .phx.gbl>
<VE************ **@TK2MSFTNGXA0 2.phx.gbl>
| Subject: Re: 2.0 controlling Databinding
| Date: Tue, 3 Jan 2006 10:02:58 -0800
| Lines: 114
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <#K************ *@TK2MSFTNGP10. phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: user-vcauk40.dsl.min dspring.com 216.175.80.128
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP10.phx. gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3683 22
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| let me be more specific.....
|
| If I drop a GridView on an aspx page and then create a datasource for it
and
| then run the page, it will bind automatically.
|
| I DON'T WANT IT TO BIND AUTOMATICALLY. I want it to bind when button1
is
| pushed and not until.
|
| How can I do that? In other words, how can I control my binding
| automatically?
|
| Thanks,
| Gary
|
| "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
| news:VE******** ********@TK2MSF TNGXA02.phx.gbl ...
| > Hi Gary,
| >
| > Welcome.
| > I've also seen your another thread in this group
| >
| > Subject: 2.0 DataSources vs. TableAdapter/Datasets
| >
| > and posted my response there. As I've mentioned there. In ASP.NET
| > application the page instances are not persisted in memory, each time
a
| > request has been processed (finished..), the page instance and other
| > related resources will be disposed... So maintain a member dataset or
| > tableadpater is not quite usable as in winform form class.... If you
do
| > need global object, you can create and store them in ApplciationStat e
/
| > Cache (or session if user specific...), and then we can reference
them
in
| > other pages' code....
| >
| > We can surely perform the same operation on those DataSet and
| > TableAdapters
| > like in winform app. e.g:
| >
| > taOD = Application("ta _order_details" )
| > dsOD = Application("ds _order_details" )
| >
| > taOD.Fill(dsOD. Order_Details)
| >
| > .............
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| >
| > --------------------
| > | From: "GaryDean" <Ga******@newsg roups.nospam>
| > | Subject: 2.0 controlling Databinding
| > | Date: Sat, 31 Dec 2005 14:23:37 -0800
| > | Lines: 33
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| > | X-RFC2646: Format=Flowed; Original
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| > | Message-ID: <e8************ **@TK2MSFTNGP14 .phx.gbl>
| > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | NNTP-Posting-Host: user-vcaur7q.dsl.min dspring.com 216.175.108.250
| > | Path:
TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP14.phx. gbl
| > | Xref: TK2MSFTNGXA02.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:3678 81
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| > |
| > | We have been noticing that questions on vs.2005/2.0 don't appear to
get
| > much
| > | in answers so I'm reposting some questions posted by some of the
| > programmers
| > | here in our organization that never got answered...
| > |
| > | In 1.1 we always did our own myDataAdapter.f ills and we liked that
| > control
| > | for lots of good reasons. Now the new DataSource (or is it a
| > | TableAdapter:Da taset) automatically fills the Gridview. How can we
| > control
| > | that fill?
| > |
| > | In a forms app there is a Form1.vb that has.....
| > | Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
| > | System.EventArg s) Handles MyBase.Load
| > |
| > | 'TODO: This line of code loads data into the
| > | 'NorthwindDataS et.Order_Detail s' table. You can move, or remove it,
as
| > | needed.
| > |
| > | Me.Order_Detail sTableAdapter.F ill(Me.Northwin dDataSet.Order_ Details)
| > |
| > | 'TODO: This line of code loads data into the
'NorthwindDataS et.Orders'
| > | table. You can move, or remove it, as needed.
| > |
| > | Me.OrdersTableA dapter1.Fill(Me .NorthwindDataS et.Orders)
| > |
| > | End Sub
| > |
| > | Here we can remove or place the code where we want but we can't find
| > that
| > | opportunity in asp apps.
| > | --
| > | Regards,
| > | Gary Blakely
| > |
| > |
| > |
| >
|
|
|

Jan 9 '06 #6
Hi Gary,

When you detach a DataSource control from Gridview, you can choose not to
clear the schema so that those defined columns still there and we can
choose to assign the datasource control to completely at runtime....

And for the new DataSource model, which no longer use vs 2003's data
component +DataGrid(which rely on designer genrated code) is also going to
resolve many problem which exists in vs 2003 since those designer generated
code is easy to be auto modifed and not easy to control....

For SqlDataSource, it's a very simple one which is suitable for RAD or
create application prototype. As far as I known most advanced developers
will create their own data access components and used with object
datasource or still use programmaticall y databinding through code. We're
not forced to use any of them...

In addition, we're still open to VS 2003 + ASP.NET 1.1 since asp.net 2.0 is
targeting .net framework 2.0 and new compilation model... If you do feel
the old asp.net 1.1 model is more suitable for developing, we can just use
vs 2003 to dev our application in 1.1 version and IIS server can support
both version deployed side by side...

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "GaryDean" <Ga******@newsg roups.nospam>
| References: <e8************ **@TK2MSFTNGP14 .phx.gbl>
<VE************ **@TK2MSFTNGXA0 2.phx.gbl>
<#K************ *@TK2MSFTNGP10. phx.gbl>
<I8************ **@TK2MSFTNGXA0 2.phx.gbl>
| Subject: Re: 2.0 controlling Databinding
| Date: Mon, 9 Jan 2006 10:35:23 -0800
| Lines: 268
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <Ow************ **@TK2MSFTNGP15 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: 216.244.8.41
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP15.phx. gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3695 65
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| Steven,
| What you say works ok but it does not provide the control we had with the
| old dataGrid and Dataset...
|
| With the datagrid I could add and edit columns at design time from a
dataset
| (maybe just a template dataset). I could apply edits to dates i.e.
{0:d},
| provide custom headings, etc. The dataset remained assigned but no fill
| was done.
|
| At run time I could do the fill on a button click event and my grid would
| appear with all custom headings and edits in place. However in 2.0 if I
do
| all of those custom headings and edits at design time and then remove the
| datasourceID I get a dialog box that says all columns will be removed and
| therefore all of my edits and headings.
|
| Being able to control the .fill in 1.1 gave us control at a lower level
of
| granularity than we have now. BTW, I see that I can control the fill in
| Forms apps still in 2.0 as the .fills are done in the form1.vb file and I
| can move those anywhere I want.
|
| Is there anyway to control the timing of just the fill in asp?
|
|
| --
| Regards,
| Gary Blakely
| "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
| news:I8******** ******@TK2MSFTN GXA02.phx.gbl.. .
| > Hi Gary,
| >
| > DataBound control automatically retrieve datas from the DataSource
control
| > is because you assign the DataSourceID of the databound control at
| > design-time, and the asp.net 2.0 databound controls will automatically
do
| > the databinding when the DataSourceID is configured... Also, this
| > automatic databinding is performed during the PreRender event......
| >
| > If you do not want such automatic databinding, you can consider either
of
| > the following means:
| >
| > 1. Assign the DataSourceID at runtime (in a certain of your control's
| > postback event) and call databind method....
| >
| > 2. Call DataSourceContr ol.Select method to get the IEnumerable
collection
| > (datasource object) and assign it to DataBoundContro l.DataSource
property
| > and call databind method....
| >
| > Here is a simple test page which have three buttons, two of them use the
| > above two means and another used for clear the databinding:
| >
| > =============== =============
| > <html xmlns="http://www.w3.org/1999/xhtml" >
| > <head runat="server">
| > <title>Untitl ed Page</title>
| > </head>
| > <body>
| > <form id="form1" runat="server">
| > <div>
| > <asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
| > ConnectionStrin g="<%$ ConnectionStrin gs:LocalNorthWi nd %>"
| > SelectCommand=" SELECT [CategoryID], [CategoryName],
| > [Description] FROM [Categories]">
| > </asp:SqlDataSour ce>
| > <asp:Button ID="btnDetach" runat="server"
OnClick="btnDet ach_Click"
| > Text="Detach" />
| > <asp:Button ID="btnBindDS" runat="server"
OnClick="btnBin dDS_Click"
| > Text="Bind DataSource Object" />
| > <asp:Button ID="btnBindDSC " runat="server"
| > OnClick="btnBin dDSC_Click" Text="BindDataS ourceControl" />
| > <asp:GridView ID="GridView1" runat="server">
| > </asp:GridView>
| >
| > </div>
| > </form>
| > </body>
| >
| >
| > =============== =============== ===============
| > public partial class GridView_GridVi ewPage : System.Web.UI.P age
| > {
| > protected void Page_Load(objec t sender, EventArgs e)
| > {
| >
| > }
| > protected void btnDetach_Click (object sender, EventArgs e)
| > {
| > GridView1.DataS ourceID = string.Empty;
| > GridView1.DataS ource = null;
| > GridView1.DataB ind();
| > }
| > protected void btnBindDS_Click (object sender, EventArgs e)
| > {
| > GridView1.DataS ourceID = string.Empty;
| > GridView1.DataS ource =
| > SqlDataSource1. Select(DataSour ceSelectArgumen ts.Empty);
| >
| > GridView1.DataB ind();
| > }
| > protected void btnBindDSC_Clic k(object sender, EventArgs e)
| > {
| > GridView1.DataS ource = null;
| > GridView1.DataS ourceID = "SqlDataSource1 ";
| > GridView1.DataB ind();
| > }
| > }
| > =============== ===========
| >
| > So ASP.NET 2.0 provide both ondemand or automatic (declarative means)
| > databinding... And usually the IDE design-time will help do most of the
| > work, however when we need advanced functions or more flexible design,
we
| > can still add our code to do it whatever means we like....
| >
| > Hope helps. Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| > --------------------
| > | From: "GaryDean" <Ga******@newsg roups.nospam>
| > | References: <e8************ **@TK2MSFTNGP14 .phx.gbl>
| > <VE************ **@TK2MSFTNGXA0 2.phx.gbl>
| > | Subject: Re: 2.0 controlling Databinding
| > | Date: Tue, 3 Jan 2006 10:02:58 -0800
| > | Lines: 114
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| > | X-RFC2646: Format=Flowed; Original
| > | Message-ID: <#K************ *@TK2MSFTNGP10. phx.gbl>
| > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | NNTP-Posting-Host: user-vcauk40.dsl.min dspring.com 216.175.80.128
| > | Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP10.phx. gbl
| > | Xref: TK2MSFTNGXA02.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:3683 22
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| > |
| > | let me be more specific.....
| > |
| > | If I drop a GridView on an aspx page and then create a datasource for
it
| > and
| > | then run the page, it will bind automatically.
| > |
| > | I DON'T WANT IT TO BIND AUTOMATICALLY. I want it to bind when
button1
| > is
| > | pushed and not until.
| > |
| > | How can I do that? In other words, how can I control my binding
| > | automatically?
| > |
| > | Thanks,
| > | Gary
| > |
| > | "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
| > | news:VE******** ********@TK2MSF TNGXA02.phx.gbl ...
| > | > Hi Gary,
| > | >
| > | > Welcome.
| > | > I've also seen your another thread in this group
| > | >
| > | > Subject: 2.0 DataSources vs. TableAdapter/Datasets
| > | >
| > | > and posted my response there. As I've mentioned there. In ASP.NET
| > | > application the page instances are not persisted in memory, each
time
| > a
| > | > request has been processed (finished..), the page instance and other
| > | > related resources will be disposed... So maintain a member dataset
or
| > | > tableadpater is not quite usable as in winform form class.... If
you
| > do
| > | > need global object, you can create and store them in
ApplciationStat e
| > /
| > | > Cache (or session if user specific...), and then we can reference
| > them
| > in
| > | > other pages' code....
| > | >
| > | > We can surely perform the same operation on those DataSet and
| > | > TableAdapters
| > | > like in winform app. e.g:
| > | >
| > | > taOD = Application("ta _order_details" )
| > | > dsOD = Application("ds _order_details" )
| > | >
| > | > taOD.Fill(dsOD. Order_Details)
| > | >
| > | > .............
| > | >
| > | > Thanks,
| > | >
| > | > Steven Cheng
| > | > Microsoft Online Support
| > | >
| > | > Get Secure! www.microsoft.com/security
| > | > (This posting is provided "AS IS", with no warranties, and confers
no
| > | > rights.)
| > | >
| > | >
| > | >
| > | > --------------------
| > | > | From: "GaryDean" <Ga******@newsg roups.nospam>
| > | > | Subject: 2.0 controlling Databinding
| > | > | Date: Sat, 31 Dec 2005 14:23:37 -0800
| > | > | Lines: 33
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| > | > | X-RFC2646: Format=Flowed; Original
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| > | > | Message-ID: <e8************ **@TK2MSFTNGP14 .phx.gbl>
| > | > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | > | NNTP-Posting-Host: user-vcaur7q.dsl.min dspring.com 216.175.108.250
| > | > | Path:
| > TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP14.phx. gbl
| > | > | Xref: TK2MSFTNGXA02.p hx.gbl
| > | > microsoft.publi c.dotnet.framew ork.aspnet:3678 81
| > | > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| > | > |
| > | > | We have been noticing that questions on vs.2005/2.0 don't appear
to
| > get
| > | > much
| > | > | in answers so I'm reposting some questions posted by some of the
| > | > programmers
| > | > | here in our organization that never got answered...
| > | > |
| > | > | In 1.1 we always did our own myDataAdapter.f ills and we liked that
| > | > control
| > | > | for lots of good reasons. Now the new DataSource (or is it a
| > | > | TableAdapter:Da taset) automatically fills the Gridview. How can
we
| > | > control
| > | > | that fill?
| > | > |
| > | > | In a forms app there is a Form1.vb that has.....
| > | > | Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
| > | > | System.EventArg s) Handles MyBase.Load
| > | > |
| > | > | 'TODO: This line of code loads data into the
| > | > | 'NorthwindDataS et.Order_Detail s' table. You can move, or remove
it,
| > as
| > | > | needed.
| > | > |
| > | > |
Me.Order_Detail sTableAdapter.F ill(Me.Northwin dDataSet.Order_ Details)
| > | > |
| > | > | 'TODO: This line of code loads data into the
| > 'NorthwindDataS et.Orders'
| > | > | table. You can move, or remove it, as needed.
| > | > |
| > | > | Me.OrdersTableA dapter1.Fill(Me .NorthwindDataS et.Orders)
| > | > |
| > | > | End Sub
| > | > |
| > | > | Here we can remove or place the code where we want but we can't
find
| > | > that
| > | > | opportunity in asp apps.
| > | > | --
| > | > | Regards,
| > | > | Gary Blakely
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|

Jan 10 '06 #7
Steven,
I actually was decoupling the DataSet from the ObjectDataSourc e where it
destroyed all the columns. You are right, that I can opt to keep the
columns when decoupling the Gridview from the ObjectDatasourc e.

I still wish we could control the fill like we can in asp 2003 and Forms
2005 :)

Thanks for clearing this up.
--
Regards,
Gary Blakely
"Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
news:lw******** ******@TK2MSFTN GXA02.phx.gbl.. .
Hi Gary,

When you detach a DataSource control from Gridview, you can choose not to
clear the schema so that those defined columns still there and we can
choose to assign the datasource control to completely at runtime....

And for the new DataSource model, which no longer use vs 2003's data
component +DataGrid(which rely on designer genrated code) is also going to
resolve many problem which exists in vs 2003 since those designer
generated
code is easy to be auto modifed and not easy to control....

For SqlDataSource, it's a very simple one which is suitable for RAD or
create application prototype. As far as I known most advanced developers
will create their own data access components and used with object
datasource or still use programmaticall y databinding through code. We're
not forced to use any of them...

In addition, we're still open to VS 2003 + ASP.NET 1.1 since asp.net 2.0
is
targeting .net framework 2.0 and new compilation model... If you do feel
the old asp.net 1.1 model is more suitable for developing, we can just use
vs 2003 to dev our application in 1.1 version and IIS server can support
both version deployed side by side...

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "GaryDean" <Ga******@newsg roups.nospam>
| References: <e8************ **@TK2MSFTNGP14 .phx.gbl>
<VE************ **@TK2MSFTNGXA0 2.phx.gbl>
<#K************ *@TK2MSFTNGP10. phx.gbl>
<I8************ **@TK2MSFTNGXA0 2.phx.gbl>
| Subject: Re: 2.0 controlling Databinding
| Date: Mon, 9 Jan 2006 10:35:23 -0800
| Lines: 268
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <Ow************ **@TK2MSFTNGP15 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: 216.244.8.41
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP15.phx. gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3695 65
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| Steven,
| What you say works ok but it does not provide the control we had with
the
| old dataGrid and Dataset...
|
| With the datagrid I could add and edit columns at design time from a
dataset
| (maybe just a template dataset). I could apply edits to dates i.e.
{0:d},
| provide custom headings, etc. The dataset remained assigned but no
fill
| was done.
|
| At run time I could do the fill on a button click event and my grid
would
| appear with all custom headings and edits in place. However in 2.0 if I
do
| all of those custom headings and edits at design time and then remove
the
| datasourceID I get a dialog box that says all columns will be removed
and
| therefore all of my edits and headings.
|
| Being able to control the .fill in 1.1 gave us control at a lower level
of
| granularity than we have now. BTW, I see that I can control the fill in
| Forms apps still in 2.0 as the .fills are done in the form1.vb file and
I
| can move those anywhere I want.
|
| Is there anyway to control the timing of just the fill in asp?
|
|
| --
| Regards,
| Gary Blakely
| "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
| news:I8******** ******@TK2MSFTN GXA02.phx.gbl.. .
| > Hi Gary,
| >
| > DataBound control automatically retrieve datas from the DataSource
control
| > is because you assign the DataSourceID of the databound control at
| > design-time, and the asp.net 2.0 databound controls will automatically
do
| > the databinding when the DataSourceID is configured... Also, this
| > automatic databinding is performed during the PreRender event......
| >
| > If you do not want such automatic databinding, you can consider either
of
| > the following means:
| >
| > 1. Assign the DataSourceID at runtime (in a certain of your control's
| > postback event) and call databind method....
| >
| > 2. Call DataSourceContr ol.Select method to get the IEnumerable
collection
| > (datasource object) and assign it to DataBoundContro l.DataSource
property
| > and call databind method....
| >
| > Here is a simple test page which have three buttons, two of them use
the
| > above two means and another used for clear the databinding:
| >
| > =============== =============
| > <html xmlns="http://www.w3.org/1999/xhtml" >
| > <head runat="server">
| > <title>Untitl ed Page</title>
| > </head>
| > <body>
| > <form id="form1" runat="server">
| > <div>
| > <asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
| > ConnectionStrin g="<%$ ConnectionStrin gs:LocalNorthWi nd %>"
| > SelectCommand=" SELECT [CategoryID], [CategoryName],
| > [Description] FROM [Categories]">
| > </asp:SqlDataSour ce>
| > <asp:Button ID="btnDetach" runat="server"
OnClick="btnDet ach_Click"
| > Text="Detach" />
| > <asp:Button ID="btnBindDS" runat="server"
OnClick="btnBin dDS_Click"
| > Text="Bind DataSource Object" />
| > <asp:Button ID="btnBindDSC " runat="server"
| > OnClick="btnBin dDSC_Click" Text="BindDataS ourceControl" />
| > <asp:GridView ID="GridView1" runat="server">
| > </asp:GridView>
| >
| > </div>
| > </form>
| > </body>
| >
| >
| > =============== =============== ===============
| > public partial class GridView_GridVi ewPage : System.Web.UI.P age
| > {
| > protected void Page_Load(objec t sender, EventArgs e)
| > {
| >
| > }
| > protected void btnDetach_Click (object sender, EventArgs e)
| > {
| > GridView1.DataS ourceID = string.Empty;
| > GridView1.DataS ource = null;
| > GridView1.DataB ind();
| > }
| > protected void btnBindDS_Click (object sender, EventArgs e)
| > {
| > GridView1.DataS ourceID = string.Empty;
| > GridView1.DataS ource =
| > SqlDataSource1. Select(DataSour ceSelectArgumen ts.Empty);
| >
| > GridView1.DataB ind();
| > }
| > protected void btnBindDSC_Clic k(object sender, EventArgs e)
| > {
| > GridView1.DataS ource = null;
| > GridView1.DataS ourceID = "SqlDataSource1 ";
| > GridView1.DataB ind();
| > }
| > }
| > =============== ===========
| >
| > So ASP.NET 2.0 provide both ondemand or automatic (declarative means)
| > databinding... And usually the IDE design-time will help do most of
the
| > work, however when we need advanced functions or more flexible design,
we
| > can still add our code to do it whatever means we like....
| >
| > Hope helps. Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| > --------------------
| > | From: "GaryDean" <Ga******@newsg roups.nospam>
| > | References: <e8************ **@TK2MSFTNGP14 .phx.gbl>
| > <VE************ **@TK2MSFTNGXA0 2.phx.gbl>
| > | Subject: Re: 2.0 controlling Databinding
| > | Date: Tue, 3 Jan 2006 10:02:58 -0800
| > | Lines: 114
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| > | X-RFC2646: Format=Flowed; Original
| > | Message-ID: <#K************ *@TK2MSFTNGP10. phx.gbl>
| > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | NNTP-Posting-Host: user-vcauk40.dsl.min dspring.com 216.175.80.128
| > | Path:
TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP10.phx. gbl
| > | Xref: TK2MSFTNGXA02.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:3683 22
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| > |
| > | let me be more specific.....
| > |
| > | If I drop a GridView on an aspx page and then create a datasource
for
it
| > and
| > | then run the page, it will bind automatically.
| > |
| > | I DON'T WANT IT TO BIND AUTOMATICALLY. I want it to bind when
button1
| > is
| > | pushed and not until.
| > |
| > | How can I do that? In other words, how can I control my binding
| > | automatically?
| > |
| > | Thanks,
| > | Gary
| > |
| > | "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
| > | news:VE******** ********@TK2MSF TNGXA02.phx.gbl ...
| > | > Hi Gary,
| > | >
| > | > Welcome.
| > | > I've also seen your another thread in this group
| > | >
| > | > Subject: 2.0 DataSources vs. TableAdapter/Datasets
| > | >
| > | > and posted my response there. As I've mentioned there. In ASP.NET
| > | > application the page instances are not persisted in memory, each
time
| > a
| > | > request has been processed (finished..), the page instance and
other
| > | > related resources will be disposed... So maintain a member dataset
or
| > | > tableadpater is not quite usable as in winform form class.... If
you
| > do
| > | > need global object, you can create and store them in
ApplciationStat e
| > /
| > | > Cache (or session if user specific...), and then we can reference
| > them
| > in
| > | > other pages' code....
| > | >
| > | > We can surely perform the same operation on those DataSet and
| > | > TableAdapters
| > | > like in winform app. e.g:
| > | >
| > | > taOD = Application("ta _order_details" )
| > | > dsOD = Application("ds _order_details" )
| > | >
| > | > taOD.Fill(dsOD. Order_Details)
| > | >
| > | > .............
| > | >
| > | > Thanks,
| > | >
| > | > Steven Cheng
| > | > Microsoft Online Support
| > | >
| > | > Get Secure! www.microsoft.com/security
| > | > (This posting is provided "AS IS", with no warranties, and confers
no
| > | > rights.)
| > | >
| > | >
| > | >
| > | > --------------------
| > | > | From: "GaryDean" <Ga******@newsg roups.nospam>
| > | > | Subject: 2.0 controlling Databinding
| > | > | Date: Sat, 31 Dec 2005 14:23:37 -0800
| > | > | Lines: 33
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| > | > | X-RFC2646: Format=Flowed; Original
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| > | > | Message-ID: <e8************ **@TK2MSFTNGP14 .phx.gbl>
| > | > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | > | NNTP-Posting-Host: user-vcaur7q.dsl.min dspring.com
216.175.108.250
| > | > | Path:
| > TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP14.phx. gbl
| > | > | Xref: TK2MSFTNGXA02.p hx.gbl
| > | > microsoft.publi c.dotnet.framew ork.aspnet:3678 81
| > | > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| > | > |
| > | > | We have been noticing that questions on vs.2005/2.0 don't appear
to
| > get
| > | > much
| > | > | in answers so I'm reposting some questions posted by some of the
| > | > programmers
| > | > | here in our organization that never got answered...
| > | > |
| > | > | In 1.1 we always did our own myDataAdapter.f ills and we liked
that
| > | > control
| > | > | for lots of good reasons. Now the new DataSource (or is it a
| > | > | TableAdapter:Da taset) automatically fills the Gridview. How can
we
| > | > control
| > | > | that fill?
| > | > |
| > | > | In a forms app there is a Form1.vb that has.....
| > | > | Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
| > | > | System.EventArg s) Handles MyBase.Load
| > | > |
| > | > | 'TODO: This line of code loads data into the
| > | > | 'NorthwindDataS et.Order_Detail s' table. You can move, or remove
it,
| > as
| > | > | needed.
| > | > |
| > | > |
Me.Order_Detail sTableAdapter.F ill(Me.Northwin dDataSet.Order_ Details)
| > | > |
| > | > | 'TODO: This line of code loads data into the
| > 'NorthwindDataS et.Orders'
| > | > | table. You can move, or remove it, as needed.
| > | > |
| > | > | Me.OrdersTableA dapter1.Fill(Me .NorthwindDataS et.Orders)
| > | > |
| > | > | End Sub
| > | > |
| > | > | Here we can remove or place the code where we want but we can't
find
| > | > that
| > | > | opportunity in asp apps.
| > | > | --
| > | > | Regards,
| > | > | Gary Blakely
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|

Jan 11 '06 #8
For control the fill like in vs 2003/ asp.net 1.1, another option is add
all the code (generated in vs 2003) in our own custom function, but do not
use the design-time interface since VS 2005 is not targeting the vs 2003
component based data access model. We need to maintain those code ourself.
At runtime, we create the DataSet and Adpater and fill the dataset to bind
to GridView or DataList....

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| From: "GaryDean" <Ga******@newsg roups.nospam>
| References: <e8************ **@TK2MSFTNGP14 .phx.gbl>
<VE************ **@TK2MSFTNGXA0 2.phx.gbl>
<#K************ *@TK2MSFTNGP10. phx.gbl>
<I8************ **@TK2MSFTNGXA0 2.phx.gbl>
<Ow************ **@TK2MSFTNGP15 .phx.gbl>
<lw************ **@TK2MSFTNGXA0 2.phx.gbl>
| Subject: Re: 2.0 controlling Databinding
| Date: Tue, 10 Jan 2006 17:03:27 -0800
| Lines: 380
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <ea************ **@tk2msftngp13 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: user-3cf8219.dsl.min dspring.com 216.244.8.41
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!tk 2msftngp13.phx. gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3699 55
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| Steven,
| I actually was decoupling the DataSet from the ObjectDataSourc e where it
| destroyed all the columns. You are right, that I can opt to keep the
| columns when decoupling the Gridview from the ObjectDatasourc e.
|
| I still wish we could control the fill like we can in asp 2003 and Forms
| 2005 :)
|
| Thanks for clearing this up.
| --
| Regards,
| Gary Blakely
| "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
| news:lw******** ******@TK2MSFTN GXA02.phx.gbl.. .
| > Hi Gary,
| >
| > When you detach a DataSource control from Gridview, you can choose not
to
| > clear the schema so that those defined columns still there and we can
| > choose to assign the datasource control to completely at runtime....
| >
| > And for the new DataSource model, which no longer use vs 2003's data
| > component +DataGrid(which rely on designer genrated code) is also going
to
| > resolve many problem which exists in vs 2003 since those designer
| > generated
| > code is easy to be auto modifed and not easy to control....
| >
| > For SqlDataSource, it's a very simple one which is suitable for RAD or
| > create application prototype. As far as I known most advanced developers
| > will create their own data access components and used with object
| > datasource or still use programmaticall y databinding through code. We're
| > not forced to use any of them...
| >
| > In addition, we're still open to VS 2003 + ASP.NET 1.1 since asp.net
2.0
| > is
| > targeting .net framework 2.0 and new compilation model... If you do feel
| > the old asp.net 1.1 model is more suitable for developing, we can just
use
| > vs 2003 to dev our application in 1.1 version and IIS server can support
| > both version deployed side by side...
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| > --------------------
| > | From: "GaryDean" <Ga******@newsg roups.nospam>
| > | References: <e8************ **@TK2MSFTNGP14 .phx.gbl>
| > <VE************ **@TK2MSFTNGXA0 2.phx.gbl>
| > <#K************ *@TK2MSFTNGP10. phx.gbl>
| > <I8************ **@TK2MSFTNGXA0 2.phx.gbl>
| > | Subject: Re: 2.0 controlling Databinding
| > | Date: Mon, 9 Jan 2006 10:35:23 -0800
| > | Lines: 268
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| > | X-RFC2646: Format=Flowed; Original
| > | Message-ID: <Ow************ **@TK2MSFTNGP15 .phx.gbl>
| > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | NNTP-Posting-Host: 216.244.8.41
| > | Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP15.phx. gbl
| > | Xref: TK2MSFTNGXA02.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:3695 65
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| > |
| > | Steven,
| > | What you say works ok but it does not provide the control we had with
| > the
| > | old dataGrid and Dataset...
| > |
| > | With the datagrid I could add and edit columns at design time from a
| > dataset
| > | (maybe just a template dataset). I could apply edits to dates i.e.
| > {0:d},
| > | provide custom headings, etc. The dataset remained assigned but no
| > fill
| > | was done.
| > |
| > | At run time I could do the fill on a button click event and my grid
| > would
| > | appear with all custom headings and edits in place. However in 2.0
if I
| > do
| > | all of those custom headings and edits at design time and then remove
| > the
| > | datasourceID I get a dialog box that says all columns will be removed
| > and
| > | therefore all of my edits and headings.
| > |
| > | Being able to control the .fill in 1.1 gave us control at a lower
level
| > of
| > | granularity than we have now. BTW, I see that I can control the fill
in
| > | Forms apps still in 2.0 as the .fills are done in the form1.vb file
and
| > I
| > | can move those anywhere I want.
| > |
| > | Is there anyway to control the timing of just the fill in asp?
| > |
| > |
| > | --
| > | Regards,
| > | Gary Blakely
| > | "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
| > | news:I8******** ******@TK2MSFTN GXA02.phx.gbl.. .
| > | > Hi Gary,
| > | >
| > | > DataBound control automatically retrieve datas from the DataSource
| > control
| > | > is because you assign the DataSourceID of the databound control at
| > | > design-time, and the asp.net 2.0 databound controls will
automatically
| > do
| > | > the databinding when the DataSourceID is configured... Also, this
| > | > automatic databinding is performed during the PreRender event......
| > | >
| > | > If you do not want such automatic databinding, you can consider
either
| > of
| > | > the following means:
| > | >
| > | > 1. Assign the DataSourceID at runtime (in a certain of your
control's
| > | > postback event) and call databind method....
| > | >
| > | > 2. Call DataSourceContr ol.Select method to get the IEnumerable
| > collection
| > | > (datasource object) and assign it to DataBoundContro l.DataSource
| > property
| > | > and call databind method....
| > | >
| > | > Here is a simple test page which have three buttons, two of them
use
| > the
| > | > above two means and another used for clear the databinding:
| > | >
| > | > =============== =============
| > | > <html xmlns="http://www.w3.org/1999/xhtml" >
| > | > <head runat="server">
| > | > <title>Untitl ed Page</title>
| > | > </head>
| > | > <body>
| > | > <form id="form1" runat="server">
| > | > <div>
| > | > <asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
| > | > ConnectionStrin g="<%$ ConnectionStrin gs:LocalNorthWi nd %>"
| > | > SelectCommand=" SELECT [CategoryID], [CategoryName],
| > | > [Description] FROM [Categories]">
| > | > </asp:SqlDataSour ce>
| > | > <asp:Button ID="btnDetach" runat="server"
| > OnClick="btnDet ach_Click"
| > | > Text="Detach" />
| > | > <asp:Button ID="btnBindDS" runat="server"
| > OnClick="btnBin dDS_Click"
| > | > Text="Bind DataSource Object" />
| > | > <asp:Button ID="btnBindDSC " runat="server"
| > | > OnClick="btnBin dDSC_Click" Text="BindDataS ourceControl" />
| > | > <asp:GridView ID="GridView1" runat="server">
| > | > </asp:GridView>
| > | >
| > | > </div>
| > | > </form>
| > | > </body>
| > | >
| > | >
| > | > =============== =============== ===============
| > | > public partial class GridView_GridVi ewPage : System.Web.UI.P age
| > | > {
| > | > protected void Page_Load(objec t sender, EventArgs e)
| > | > {
| > | >
| > | > }
| > | > protected void btnDetach_Click (object sender, EventArgs e)
| > | > {
| > | > GridView1.DataS ourceID = string.Empty;
| > | > GridView1.DataS ource = null;
| > | > GridView1.DataB ind();
| > | > }
| > | > protected void btnBindDS_Click (object sender, EventArgs e)
| > | > {
| > | > GridView1.DataS ourceID = string.Empty;
| > | > GridView1.DataS ource =
| > | > SqlDataSource1. Select(DataSour ceSelectArgumen ts.Empty);
| > | >
| > | > GridView1.DataB ind();
| > | > }
| > | > protected void btnBindDSC_Clic k(object sender, EventArgs e)
| > | > {
| > | > GridView1.DataS ource = null;
| > | > GridView1.DataS ourceID = "SqlDataSource1 ";
| > | > GridView1.DataB ind();
| > | > }
| > | > }
| > | > =============== ===========
| > | >
| > | > So ASP.NET 2.0 provide both ondemand or automatic (declarative
means)
| > | > databinding... And usually the IDE design-time will help do most of
| > the
| > | > work, however when we need advanced functions or more flexible
design,
| > we
| > | > can still add our code to do it whatever means we like....
| > | >
| > | > Hope helps. Thanks,
| > | >
| > | > Steven Cheng
| > | > Microsoft Online Support
| > | >
| > | > Get Secure! www.microsoft.com/security
| > | > (This posting is provided "AS IS", with no warranties, and confers
no
| > | > rights.)
| > | > --------------------
| > | > | From: "GaryDean" <Ga******@newsg roups.nospam>
| > | > | References: <e8************ **@TK2MSFTNGP14 .phx.gbl>
| > | > <VE************ **@TK2MSFTNGXA0 2.phx.gbl>
| > | > | Subject: Re: 2.0 controlling Databinding
| > | > | Date: Tue, 3 Jan 2006 10:02:58 -0800
| > | > | Lines: 114
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| > | > | X-RFC2646: Format=Flowed; Original
| > | > | Message-ID: <#K************ *@TK2MSFTNGP10. phx.gbl>
| > | > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | > | NNTP-Posting-Host: user-vcauk40.dsl.min dspring.com 216.175.80.128
| > | > | Path:
| > TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP10.phx. gbl
| > | > | Xref: TK2MSFTNGXA02.p hx.gbl
| > | > microsoft.publi c.dotnet.framew ork.aspnet:3683 22
| > | > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| > | > |
| > | > | let me be more specific.....
| > | > |
| > | > | If I drop a GridView on an aspx page and then create a datasource
| > for
| > it
| > | > and
| > | > | then run the page, it will bind automatically.
| > | > |
| > | > | I DON'T WANT IT TO BIND AUTOMATICALLY. I want it to bind when
| > button1
| > | > is
| > | > | pushed and not until.
| > | > |
| > | > | How can I do that? In other words, how can I control my binding
| > | > | automatically?
| > | > |
| > | > | Thanks,
| > | > | Gary
| > | > |
| > | > | "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in
message
| > | > | news:VE******** ********@TK2MSF TNGXA02.phx.gbl ...
| > | > | > Hi Gary,
| > | > | >
| > | > | > Welcome.
| > | > | > I've also seen your another thread in this group
| > | > | >
| > | > | > Subject: 2.0 DataSources vs. TableAdapter/Datasets
| > | > | >
| > | > | > and posted my response there. As I've mentioned there. In
ASP.NET
| > | > | > application the page instances are not persisted in memory, each
| > time
| > | > a
| > | > | > request has been processed (finished..), the page instance and
| > other
| > | > | > related resources will be disposed... So maintain a member
dataset
| > or
| > | > | > tableadpater is not quite usable as in winform form class....
If
| > you
| > | > do
| > | > | > need global object, you can create and store them in
| > ApplciationStat e
| > | > /
| > | > | > Cache (or session if user specific...), and then we can
reference
| > | > them
| > | > in
| > | > | > other pages' code....
| > | > | >
| > | > | > We can surely perform the same operation on those DataSet and
| > | > | > TableAdapters
| > | > | > like in winform app. e.g:
| > | > | >
| > | > | > taOD = Application("ta _order_details" )
| > | > | > dsOD = Application("ds _order_details" )
| > | > | >
| > | > | > taOD.Fill(dsOD. Order_Details)
| > | > | >
| > | > | > .............
| > | > | >
| > | > | > Thanks,
| > | > | >
| > | > | > Steven Cheng
| > | > | > Microsoft Online Support
| > | > | >
| > | > | > Get Secure! www.microsoft.com/security
| > | > | > (This posting is provided "AS IS", with no warranties, and
confers
| > no
| > | > | > rights.)
| > | > | >
| > | > | >
| > | > | >
| > | > | > --------------------
| > | > | > | From: "GaryDean" <Ga******@newsg roups.nospam>
| > | > | > | Subject: 2.0 controlling Databinding
| > | > | > | Date: Sat, 31 Dec 2005 14:23:37 -0800
| > | > | > | Lines: 33
| > | > | > | X-Priority: 3
| > | > | > | X-MSMail-Priority: Normal
| > | > | > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| > | > | > | X-RFC2646: Format=Flowed; Original
| > | > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| > | > | > | Message-ID: <e8************ **@TK2MSFTNGP14 .phx.gbl>
| > | > | > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | > | > | NNTP-Posting-Host: user-vcaur7q.dsl.min dspring.com
| > 216.175.108.250
| > | > | > | Path:
| > | > TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP14.phx. gbl
| > | > | > | Xref: TK2MSFTNGXA02.p hx.gbl
| > | > | > microsoft.publi c.dotnet.framew ork.aspnet:3678 81
| > | > | > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| > | > | > |
| > | > | > | We have been noticing that questions on vs.2005/2.0 don't
appear
| > to
| > | > get
| > | > | > much
| > | > | > | in answers so I'm reposting some questions posted by some of
the
| > | > | > programmers
| > | > | > | here in our organization that never got answered...
| > | > | > |
| > | > | > | In 1.1 we always did our own myDataAdapter.f ills and we liked
| > that
| > | > | > control
| > | > | > | for lots of good reasons. Now the new DataSource (or is it a
| > | > | > | TableAdapter:Da taset) automatically fills the Gridview. How
can
| > we
| > | > | > control
| > | > | > | that fill?
| > | > | > |
| > | > | > | In a forms app there is a Form1.vb that has.....
| > | > | > | Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e
As
| > | > | > | System.EventArg s) Handles MyBase.Load
| > | > | > |
| > | > | > | 'TODO: This line of code loads data into the
| > | > | > | 'NorthwindDataS et.Order_Detail s' table. You can move, or
remove
| > it,
| > | > as
| > | > | > | needed.
| > | > | > |
| > | > | > |
| > Me.Order_Detail sTableAdapter.F ill(Me.Northwin dDataSet.Order_ Details)
| > | > | > |
| > | > | > | 'TODO: This line of code loads data into the
| > | > 'NorthwindDataS et.Orders'
| > | > | > | table. You can move, or remove it, as needed.
| > | > | > |
| > | > | > | Me.OrdersTableA dapter1.Fill(Me .NorthwindDataS et.Orders)
| > | > | > |
| > | > | > | End Sub
| > | > | > |
| > | > | > | Here we can remove or place the code where we want but we
can't
| > find
| > | > | > that
| > | > | > | opportunity in asp apps.
| > | > | > | --
| > | > | > | Regards,
| > | > | > | Gary Blakely
| > | > | > |
| > | > | > |
| > | > | > |
| > | > | >
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|

Jan 11 '06 #9

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

Similar topics

3
3153
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, depending on which menu item a user selects. Each of these controls follows the same basic pattern: Get a dataset from the database and then display the results using basic databinding. Everything works fine except that I'll occaisionally get an...
6
1995
by: Manny Chohan | last post by:
Hi Guys, i have the following linkbutton with visibility conditionally controlled from codebehind: <asp:LinkButton id="test" style="Z-INDEX: 101; LEFT: 464px; POSITION: absolute; TOP: 160px" runat="server" Visible="<%# boolVisible %>">LinkButton</asp:LinkButton> In Codebehind: Public boolVisible As Boolean Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
3
1859
by: John Bailey | last post by:
When I first built a few web pages in ASP .Net 2.0, I thought it was great. The formview and detailview contorls would automatically layout the controls for you, the update methods were automatically generated, and the objectdatasource let you design against a business object through the gui. Now I am working on my first real web application on 2.0, and I find this automatic functionality doesn't do much beyond allowing me to generate...
4
1656
by: Nathan Sokalski | last post by:
I have two databinding expressions (the first & last names from a DB) that I want to assign to the text property of a Label so that the result is LASTNAME,FIRSTNAME. At the moment, I have the following which I know works when I use it by itself: text='<%# DataBinder.Eval(Container,"DataItem.membernames.lname") %>' What I need to do is somehow concatenate this databinding expression, a comma, and another databinding expression for the...
2
1303
by: Tubs | last post by:
I am trying to use data binding to avoid having to write event handlers everywhere for my data transfer from controls to data source and all is working well except, i have a condition i would like to place on the value before i let it go through. I have built an expression evaluator to determine when something is valid versus invalid. My problem is that when i trap the format event of the data binding, i can get to the value before it...
9
2104
by: Dennis | last post by:
I have tried using Databinding for my application but always seem to find it very restrictive (maybe I don't completely understand it enough). I always seem to find it much easier to display a form, have the user fill it out then put the data into a class representing a data row and then use the OLEadaptor or OLECommands to update the database. My question is has anyone really used databinding in anything but the simpliest application...
8
2088
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 generic type Field<T> (see sample code). public class Employee { public Field<stringForename
1
1626
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; Performance with databinding is good in asp.net 2.0 ? Would you prefer: databinding or set value to Text property of control ?
6
1412
by: =?Utf-8?B?QmVuLg==?= | last post by:
Hi, I'm more of a windows programmer than ASP and I've having a little difficulty in ASP.Net (framework 2.0) - VB.net I have a datagrid on an aspx page and the html is building the display in a table row by row. A sample row being <tr> <td>Comment:</td>
0
8821
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8718
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9340
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9196
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9103
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6646
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4477
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4738
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2118
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.