473,549 Members | 2,531 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Proper DataBinding

Hi,

the following code displays a search result in a datagrid and is working
without problems. But I think the way I have done is not correct especially
databind(). could anyone help me to rearange it?

Sub grdProfilesResu lt_Edit(ByVal sender As Object, ByVal e As
DataGridCommand EventArgs)
grdProfilesResu lt.EditItemInde x = e.Item.ItemInde x
grdProfilesResu lt.DataSource = Session("PDataS ource")
grdProfilesResu lt.DataBind()
End Sub

Sub grdProfilesResu lt_Cancel(ByVal Sender As Object, ByVal e As
DataGridCommand EventArgs)
grdProfilesResu lt.EditItemInde x = e.Item.ItemInde x - 1
grdProfilesResu lt.DataSource = Session("PDataS ource")
grdProfilesResu lt.DataBind()
End Sub

Sub grdProfilesResu lt_Update(ByVal Sender As Object, ByVal e As
DataGridCommand EventArgs)

If Page.IsValid Then

Session("PDataS ource") = Nothing

Dim strID As String
strID = CType(e.Item.Fi ndControl("txtI D"), Label).Text

Dim strName As String
strName = CType(e.Item.Fi ndControl("txtN ame"), TextBox).Text

Dim Con As New Data.OleDb.OleD bConnection( _
"Provider=Micro soft.Jet.OLEDB. 4.0;" & _
"Data Source=c:\InetP ub\wwwroot\Mach ineShop\Data\Ma chineShop.mdb")

Dim cmd As New OleDbCommand

cmd.CommandText = "Update Profiles SET Name = '" & strName & "'
Where MilitaryID = '" & strID & "'"
cmd.CommandType = CommandType.Tex t
Con.Open()

Try
cmd.ExecuteNonQ uery()

Catch ex As Exception
Response.Write( ex.ToString)
Finally
Con.Close()
End Try

grdProfilesResu lt.EditItemInde x = -1
BindData()

End If
End Sub

Private Sub BindData()
lblMessage.Visi ble = False

Dim SQLADDER As String = ""
Dim dr As OleDbDataReader
Dim cmd As New OleDbCommand
Dim rdr As OleDbDataReader

Dim txtProfileID As String = Request.Form("t xtProfileID")
Dim txtProfileName As String = Request.Form("t xtProfileName")
Dim txtRank As String = Request.Form("t xtRank")
Dim txtProfession As String = Request.Form("t xtProfession")

If LCase(txtProfil eID) <> "any" Then
SQLADDER = SQLADDER & " AND ID = '" & txtProfileID & "' "
End If

If LCase(txtProfil eName) <> "any" Then
SQLADDER = SQLADDER & " AND Name = '" & txtProfileName & "' "
End If

If LCase(txtRank) <> "any" Then
SQLADDER = SQLADDER & " AND Rank = '" & txtRank & "' "
End If

If LCase(txtProfes sion) <> "any" Then
SQLADDER = SQLADDER & " AND Profession = '" & txtProfession & "'
"
End If

If Len(SQLADDER) > 0 Then
SQLADDER = " WHERE " & Mid(SQLADDER, 5)
End If

Dim strSQL As String = "Select * from Profiles " & SQLADDER

Dim Con As New Data.OleDb.OleD bConnection( _
"Provider=Micro soft.Jet.OLEDB. 4.0;" & _
"Data Source=c:\InetP ub\wwwroot\Mach ineShop\Data\Sh op.mdb")

Con.Open()

cmd = New OleDbCommand(st rSQL, Con)
Dim adapter As OleDbDataAdapte r = New OleDbDataAdapte r
adapter.SelectC ommand = cmd

Dim PDataSet As DataSet = New DataSet
adapter.Fill(PD ataSet)
Dim boolFlag As Boolean = True

If PDataSet.Tables Is Nothing Or PDataSet.Tables (0).Rows.Count = 0
Then
lblMessage.Visi ble = True
lblMessage.Fore Color = System.Drawing. Color.Red
lblMessage.Text = ("No record available for the selection
criteria.")
boolFlag = False
Else
Session("PDataS ource") = PDataSet
boolFlag = True
End If

If boolFlag = True Then
grdProfilesResu lt.DataSource = PDataSet
grdProfilesResu lt.DataBind()
End If
cmd.Dispose()
Con.Close()
End Sub

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
If Not Page.IsPostBack Then
BindData()
End If

End Sub

Private Sub grdProfilesResu lt_PageIndexCha nged(ByVal sender As
System.Object, ByVal e As
System.Web.UI.W ebControls.Data GridPageChanged EventArgs) Handles
grdProfilesResu lt.PageIndexCha nged
grdProfilesResu lt.CurrentPageI ndex = e.NewPageIndex
grdProfilesResu lt.DataSource = Session("PDataS ource")
grdProfilesResu lt.DataBind()
End Sub

Here datagrid_update is not working, "Instance of object not found " error
occurs.
--
LUIS ESTEBAN VALENCIA
MICROSOFT DCE 3.
MIEMBRO ACTIVO DE ALIANZADEV
http://spaces.msn.com/members/extremed/
Nov 19 '05 #1
3 1177
Man....you've got a lot of code there....

go to the Exception Catch block and either (1) Place a Breakpoint there and
Inspect ex when the program goes into break mode, or (2) have it write out
ex.Message & ex.StackTrace to see exactly which procedure call is raising
the error.

"Luis Esteban Valencia" <lu*******@hace b.com> wrote in message
news:uh******** *****@TK2MSFTNG P09.phx.gbl...
Hi,

the following code displays a search result in a datagrid and is working
without problems. But I think the way I have done is not correct especially databind(). could anyone help me to rearange it?

Sub grdProfilesResu lt_Edit(ByVal sender As Object, ByVal e As
DataGridCommand EventArgs)
grdProfilesResu lt.EditItemInde x = e.Item.ItemInde x
grdProfilesResu lt.DataSource = Session("PDataS ource")
grdProfilesResu lt.DataBind()
End Sub

Sub grdProfilesResu lt_Cancel(ByVal Sender As Object, ByVal e As
DataGridCommand EventArgs)
grdProfilesResu lt.EditItemInde x = e.Item.ItemInde x - 1
grdProfilesResu lt.DataSource = Session("PDataS ource")
grdProfilesResu lt.DataBind()
End Sub

Sub grdProfilesResu lt_Update(ByVal Sender As Object, ByVal e As
DataGridCommand EventArgs)

If Page.IsValid Then

Session("PDataS ource") = Nothing

Dim strID As String
strID = CType(e.Item.Fi ndControl("txtI D"), Label).Text

Dim strName As String
strName = CType(e.Item.Fi ndControl("txtN ame"), TextBox).Text

Dim Con As New Data.OleDb.OleD bConnection( _
"Provider=Micro soft.Jet.OLEDB. 4.0;" & _
"Data Source=c:\InetP ub\wwwroot\Mach ineShop\Data\Ma chineShop.mdb")

Dim cmd As New OleDbCommand

cmd.CommandText = "Update Profiles SET Name = '" & strName & "' Where MilitaryID = '" & strID & "'"
cmd.CommandType = CommandType.Tex t
Con.Open()

Try
cmd.ExecuteNonQ uery()

Catch ex As Exception
Response.Write( ex.ToString)
Finally
Con.Close()
End Try

grdProfilesResu lt.EditItemInde x = -1
BindData()

End If
End Sub

Private Sub BindData()
lblMessage.Visi ble = False

Dim SQLADDER As String = ""
Dim dr As OleDbDataReader
Dim cmd As New OleDbCommand
Dim rdr As OleDbDataReader

Dim txtProfileID As String = Request.Form("t xtProfileID")
Dim txtProfileName As String = Request.Form("t xtProfileName")
Dim txtRank As String = Request.Form("t xtRank")
Dim txtProfession As String = Request.Form("t xtProfession")

If LCase(txtProfil eID) <> "any" Then
SQLADDER = SQLADDER & " AND ID = '" & txtProfileID & "' "
End If

If LCase(txtProfil eName) <> "any" Then
SQLADDER = SQLADDER & " AND Name = '" & txtProfileName & "' "
End If

If LCase(txtRank) <> "any" Then
SQLADDER = SQLADDER & " AND Rank = '" & txtRank & "' "
End If

If LCase(txtProfes sion) <> "any" Then
SQLADDER = SQLADDER & " AND Profession = '" & txtProfession & "' "
End If

If Len(SQLADDER) > 0 Then
SQLADDER = " WHERE " & Mid(SQLADDER, 5)
End If

Dim strSQL As String = "Select * from Profiles " & SQLADDER

Dim Con As New Data.OleDb.OleD bConnection( _
"Provider=Micro soft.Jet.OLEDB. 4.0;" & _
"Data Source=c:\InetP ub\wwwroot\Mach ineShop\Data\Sh op.mdb")

Con.Open()

cmd = New OleDbCommand(st rSQL, Con)
Dim adapter As OleDbDataAdapte r = New OleDbDataAdapte r
adapter.SelectC ommand = cmd

Dim PDataSet As DataSet = New DataSet
adapter.Fill(PD ataSet)
Dim boolFlag As Boolean = True

If PDataSet.Tables Is Nothing Or PDataSet.Tables (0).Rows.Count = 0
Then
lblMessage.Visi ble = True
lblMessage.Fore Color = System.Drawing. Color.Red
lblMessage.Text = ("No record available for the selection
criteria.")
boolFlag = False
Else
Session("PDataS ource") = PDataSet
boolFlag = True
End If

If boolFlag = True Then
grdProfilesResu lt.DataSource = PDataSet
grdProfilesResu lt.DataBind()
End If
cmd.Dispose()
Con.Close()
End Sub

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
If Not Page.IsPostBack Then
BindData()
End If

End Sub

Private Sub grdProfilesResu lt_PageIndexCha nged(ByVal sender As
System.Object, ByVal e As
System.Web.UI.W ebControls.Data GridPageChanged EventArgs) Handles
grdProfilesResu lt.PageIndexCha nged
grdProfilesResu lt.CurrentPageI ndex = e.NewPageIndex
grdProfilesResu lt.DataSource = Session("PDataS ource")
grdProfilesResu lt.DataBind()
End Sub

Here datagrid_update is not working, "Instance of object not found " error
occurs.
--
LUIS ESTEBAN VALENCIA
MICROSOFT DCE 3.
MIEMBRO ACTIVO DE ALIANZADEV
http://spaces.msn.com/members/extremed/

Nov 19 '05 #2

I will explain the problems;

1. Now it takes two clicks for updating.

2. After updating only ID appears in the updated row, all other row values
disappers but the actual data is there in the table.

3. After updating with two clicks "No record available for the selection
criteria".

4. How can I avoid using Session from the fllowing sub and just put
databind().

Private Sub grdProfilesResu lt_PageIndexCha nged(ByVal sender As
System.Object, ByVal e As
System.Web.UI.W ebControls.Data GridPageChanged EventArgs) Handles
grdProfilesResu lt.PageIndexCha nged
grdProfilesResu lt.CurrentPageI ndex = e.NewPageIndex
grdProfilesResu lt.DataSource = Session("PDataS ource")
grdProfilesResu lt.DataBind()
End Sub

How can I overcome these problems?

ayha

--
LUIS ESTEBAN VALENCIA
MICROSOFT DCE 3.
MIEMBRO ACTIVO DE ALIANZADEV
http://spaces.msn.com/members/extremed/
"David Jessee" <dj*****@housto n.rr.com> escribió en el mensaje
news:e6******** ******@TK2MSFTN GP12.phx.gbl...
Man....you've got a lot of code there....

go to the Exception Catch block and either (1) Place a Breakpoint there and Inspect ex when the program goes into break mode, or (2) have it write out
ex.Message & ex.StackTrace to see exactly which procedure call is raising
the error.

"Luis Esteban Valencia" <lu*******@hace b.com> wrote in message
news:uh******** *****@TK2MSFTNG P09.phx.gbl...
Hi,

the following code displays a search result in a datagrid and is working
without problems. But I think the way I have done is not correct especially
databind(). could anyone help me to rearange it?

Sub grdProfilesResu lt_Edit(ByVal sender As Object, ByVal e As
DataGridCommand EventArgs)
grdProfilesResu lt.EditItemInde x = e.Item.ItemInde x
grdProfilesResu lt.DataSource = Session("PDataS ource")
grdProfilesResu lt.DataBind()
End Sub

Sub grdProfilesResu lt_Cancel(ByVal Sender As Object, ByVal e As
DataGridCommand EventArgs)
grdProfilesResu lt.EditItemInde x = e.Item.ItemInde x - 1
grdProfilesResu lt.DataSource = Session("PDataS ource")
grdProfilesResu lt.DataBind()
End Sub

Sub grdProfilesResu lt_Update(ByVal Sender As Object, ByVal e As
DataGridCommand EventArgs)

If Page.IsValid Then

Session("PDataS ource") = Nothing

Dim strID As String
strID = CType(e.Item.Fi ndControl("txtI D"), Label).Text

Dim strName As String
strName = CType(e.Item.Fi ndControl("txtN ame"), TextBox).Text

Dim Con As New Data.OleDb.OleD bConnection( _
"Provider=Micro soft.Jet.OLEDB. 4.0;" & _
"Data Source=c:\InetP ub\wwwroot\Mach ineShop\Data\Ma chineShop.mdb")

Dim cmd As New OleDbCommand

cmd.CommandText = "Update Profiles SET Name = '" & strName & "'
Where MilitaryID = '" & strID & "'"
cmd.CommandType = CommandType.Tex t
Con.Open()

Try
cmd.ExecuteNonQ uery()

Catch ex As Exception
Response.Write( ex.ToString)
Finally
Con.Close()
End Try

grdProfilesResu lt.EditItemInde x = -1
BindData()

End If
End Sub

Private Sub BindData()
lblMessage.Visi ble = False

Dim SQLADDER As String = ""
Dim dr As OleDbDataReader
Dim cmd As New OleDbCommand
Dim rdr As OleDbDataReader

Dim txtProfileID As String = Request.Form("t xtProfileID")
Dim txtProfileName As String = Request.Form("t xtProfileName")
Dim txtRank As String = Request.Form("t xtRank")
Dim txtProfession As String = Request.Form("t xtProfession")

If LCase(txtProfil eID) <> "any" Then
SQLADDER = SQLADDER & " AND ID = '" & txtProfileID & "' "
End If

If LCase(txtProfil eName) <> "any" Then
SQLADDER = SQLADDER & " AND Name = '" & txtProfileName & "'
" End If

If LCase(txtRank) <> "any" Then
SQLADDER = SQLADDER & " AND Rank = '" & txtRank & "' "
End If

If LCase(txtProfes sion) <> "any" Then
SQLADDER = SQLADDER & " AND Profession = '" & txtProfession & "'
"
End If

If Len(SQLADDER) > 0 Then
SQLADDER = " WHERE " & Mid(SQLADDER, 5)
End If

Dim strSQL As String = "Select * from Profiles " & SQLADDER

Dim Con As New Data.OleDb.OleD bConnection( _
"Provider=Micro soft.Jet.OLEDB. 4.0;" & _
"Data Source=c:\InetP ub\wwwroot\Mach ineShop\Data\Sh op.mdb")

Con.Open()

cmd = New OleDbCommand(st rSQL, Con)
Dim adapter As OleDbDataAdapte r = New OleDbDataAdapte r
adapter.SelectC ommand = cmd

Dim PDataSet As DataSet = New DataSet
adapter.Fill(PD ataSet)
Dim boolFlag As Boolean = True

If PDataSet.Tables Is Nothing Or PDataSet.Tables (0).Rows.Count =

0 Then
lblMessage.Visi ble = True
lblMessage.Fore Color = System.Drawing. Color.Red
lblMessage.Text = ("No record available for the selection
criteria.")
boolFlag = False
Else
Session("PDataS ource") = PDataSet
boolFlag = True
End If

If boolFlag = True Then
grdProfilesResu lt.DataSource = PDataSet
grdProfilesResu lt.DataBind()
End If
cmd.Dispose()
Con.Close()
End Sub

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
If Not Page.IsPostBack Then
BindData()
End If

End Sub

Private Sub grdProfilesResu lt_PageIndexCha nged(ByVal sender As
System.Object, ByVal e As
System.Web.UI.W ebControls.Data GridPageChanged EventArgs) Handles
grdProfilesResu lt.PageIndexCha nged
grdProfilesResu lt.CurrentPageI ndex = e.NewPageIndex
grdProfilesResu lt.DataSource = Session("PDataS ource")
grdProfilesResu lt.DataBind()
End Sub

Here datagrid_update is not working, "Instance of object not found " error occurs.
--
LUIS ESTEBAN VALENCIA
MICROSOFT DCE 3.
MIEMBRO ACTIVO DE ALIANZADEV
http://spaces.msn.com/members/extremed/


Nov 19 '05 #3
Well, for #4, I can tell you how I do databinding. It might work for you...

In your code Behind....

Protected Readonly Property TheDataSource() as Datatable
Get
' The code that gets your data table for binding, based on all
'Of your page properties (prefereable from some otehr data access
'Class so that all of the implementation doesn't clutter the page
Return theDataTable
End Get
End Property

then in your aspx file

<asp:DataGrid id="x" runat="server" DataSource='<%# TheDataSource %>'
<asp:dataGri d>
so when you call databind, your grid knows enough to bind itself.

For #3, Why is that happening, is it because the table is not being created,
or is it becauser no rows are returned?
"Luis Esteban Valencia" <lu*******@hace b.com> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
I will explain the problems;

1. Now it takes two clicks for updating.

2. After updating only ID appears in the updated row, all other row values
disappers but the actual data is there in the table.

3. After updating with two clicks "No record available for the selection
criteria".

4. How can I avoid using Session from the fllowing sub and just put
databind().

Private Sub grdProfilesResu lt_PageIndexCha nged(ByVal sender As
System.Object, ByVal e As
System.Web.UI.W ebControls.Data GridPageChanged EventArgs) Handles
grdProfilesResu lt.PageIndexCha nged
grdProfilesResu lt.CurrentPageI ndex = e.NewPageIndex
grdProfilesResu lt.DataSource = Session("PDataS ource")
grdProfilesResu lt.DataBind()
End Sub

How can I overcome these problems?

ayha

--
LUIS ESTEBAN VALENCIA
MICROSOFT DCE 3.
MIEMBRO ACTIVO DE ALIANZADEV
http://spaces.msn.com/members/extremed/
"David Jessee" <dj*****@housto n.rr.com> escribió en el mensaje
news:e6******** ******@TK2MSFTN GP12.phx.gbl...
Man....you've got a lot of code there....

go to the Exception Catch block and either (1) Place a Breakpoint there and
Inspect ex when the program goes into break mode, or (2) have it write out
ex.Message & ex.StackTrace to see exactly which procedure call is raising the error.

"Luis Esteban Valencia" <lu*******@hace b.com> wrote in message
news:uh******** *****@TK2MSFTNG P09.phx.gbl...
Hi,

the following code displays a search result in a datagrid and is working without problems. But I think the way I have done is not correct

especially
databind(). could anyone help me to rearange it?

Sub grdProfilesResu lt_Edit(ByVal sender As Object, ByVal e As
DataGridCommand EventArgs)
grdProfilesResu lt.EditItemInde x = e.Item.ItemInde x
grdProfilesResu lt.DataSource = Session("PDataS ource")
grdProfilesResu lt.DataBind()
End Sub

Sub grdProfilesResu lt_Cancel(ByVal Sender As Object, ByVal e As
DataGridCommand EventArgs)
grdProfilesResu lt.EditItemInde x = e.Item.ItemInde x - 1
grdProfilesResu lt.DataSource = Session("PDataS ource")
grdProfilesResu lt.DataBind()
End Sub

Sub grdProfilesResu lt_Update(ByVal Sender As Object, ByVal e As
DataGridCommand EventArgs)

If Page.IsValid Then

Session("PDataS ource") = Nothing

Dim strID As String
strID = CType(e.Item.Fi ndControl("txtI D"), Label).Text

Dim strName As String
strName = CType(e.Item.Fi ndControl("txtN ame"), TextBox).Text
Dim Con As New Data.OleDb.OleD bConnection( _
"Provider=Micro soft.Jet.OLEDB. 4.0;" & _
"Data Source=c:\InetP ub\wwwroot\Mach ineShop\Data\Ma chineShop.mdb")

Dim cmd As New OleDbCommand

cmd.CommandText = "Update Profiles SET Name = '" & strName &
"'
Where MilitaryID = '" & strID & "'"
cmd.CommandType = CommandType.Tex t
Con.Open()

Try
cmd.ExecuteNonQ uery()

Catch ex As Exception
Response.Write( ex.ToString)
Finally
Con.Close()
End Try

grdProfilesResu lt.EditItemInde x = -1
BindData()

End If
End Sub

Private Sub BindData()
lblMessage.Visi ble = False

Dim SQLADDER As String = ""
Dim dr As OleDbDataReader
Dim cmd As New OleDbCommand
Dim rdr As OleDbDataReader

Dim txtProfileID As String = Request.Form("t xtProfileID")
Dim txtProfileName As String = Request.Form("t xtProfileName")
Dim txtRank As String = Request.Form("t xtRank")
Dim txtProfession As String = Request.Form("t xtProfession")

If LCase(txtProfil eID) <> "any" Then
SQLADDER = SQLADDER & " AND ID = '" & txtProfileID & "' "
End If

If LCase(txtProfil eName) <> "any" Then
SQLADDER = SQLADDER & " AND Name = '" & txtProfileName &
"' " End If

If LCase(txtRank) <> "any" Then
SQLADDER = SQLADDER & " AND Rank = '" & txtRank & "' "
End If

If LCase(txtProfes sion) <> "any" Then
SQLADDER = SQLADDER & " AND Profession = '" &
txtProfession
&
"'
"
End If

If Len(SQLADDER) > 0 Then
SQLADDER = " WHERE " & Mid(SQLADDER, 5)
End If

Dim strSQL As String = "Select * from Profiles " & SQLADDER

Dim Con As New Data.OleDb.OleD bConnection( _
"Provider=Micro soft.Jet.OLEDB. 4.0;" & _
"Data
Source=c:\InetP ub\wwwroot\Mach ineShop\Data\Sh op.mdb")
Con.Open()

cmd = New OleDbCommand(st rSQL, Con)
Dim adapter As OleDbDataAdapte r = New OleDbDataAdapte r
adapter.SelectC ommand = cmd

Dim PDataSet As DataSet = New DataSet
adapter.Fill(PD ataSet)
Dim boolFlag As Boolean = True

If PDataSet.Tables Is Nothing Or PDataSet.Tables (0).Rows.Count

= 0 Then
lblMessage.Visi ble = True
lblMessage.Fore Color = System.Drawing. Color.Red
lblMessage.Text = ("No record available for the selection
criteria.")
boolFlag = False
Else
Session("PDataS ource") = PDataSet
boolFlag = True
End If

If boolFlag = True Then
grdProfilesResu lt.DataSource = PDataSet
grdProfilesResu lt.DataBind()
End If
cmd.Dispose()
Con.Close()
End Sub

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
If Not Page.IsPostBack Then
BindData()
End If

End Sub

Private Sub grdProfilesResu lt_PageIndexCha nged(ByVal sender As
System.Object, ByVal e As
System.Web.UI.W ebControls.Data GridPageChanged EventArgs) Handles
grdProfilesResu lt.PageIndexCha nged
grdProfilesResu lt.CurrentPageI ndex = e.NewPageIndex
grdProfilesResu lt.DataSource = Session("PDataS ource")
grdProfilesResu lt.DataBind()
End Sub

Here datagrid_update is not working, "Instance of object not found " error occurs.
--
LUIS ESTEBAN VALENCIA
MICROSOFT DCE 3.
MIEMBRO ACTIVO DE ALIANZADEV
http://spaces.msn.com/members/extremed/



Nov 19 '05 #4

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

Similar topics

5
1780
by: DKode | last post by:
I have created an application that will be used for my IT depts. Tasks. I believe I have created the correct architecture but it doesn't feel correct. Could I get opionions if I am headed in the right direction? Here is how I have it set up. UI -> Business Rules layer -> WebService (Broadcasting from SQL Server) -> DataLayer -> SQL Helper...
3
3139
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...
3
1846
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...
4
1640
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...
9
2089
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...
8
2170
by: GaryDean | last post by:
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.fills and we liked that control for lots of good reasons. Now the new DataSource (or is it a...
0
1314
by: Wayne Sepega | last post by:
I have the following Object DataSource <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetCustomer" TypeName="Customers" DataObjectTypeName="Customer" InsertMethod="InsertCustomer" OnUpdated="ObjectDataSource1_Updated" UpdateMethod="UpdateCustomer" OnSelected="ObjectDataSource1_Selected">
8
2078
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
1621
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 ?
0
7526
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...
0
7457
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...
0
7723
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. ...
1
7483
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...
0
5092
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3504
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...
0
3487
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1949
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1063
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.