actual record

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jose

    #1

    actual record

    How obtain the current record ? this is my code:

    Dim fila As DataRow

    Dim llaveprimaria(0 ) As DataColumn

    llaveprimaria(0 ) = dasedo.Tables(" tabest").Column s("codigo")

    dasedo.Tables(" tabest").Primar yKey() = llaveprimaria

    fila = dasedo.Tables(" tabest").Rows.F ind(c_idfind)

    Me.BindingConte xt(dasedo, "tabest").Posit ion = 1 (bad code line help me
    please)


  • Cor Ligthert [MVP]

    #2
    Re: actual record

    Jose,

    Have a look at this sample where your problem is done.

    There is as well your next problem in it.




    I hope this helps,

    Cor

    "Jose" <josenospam@uni ca.com> schreef in bericht
    news:e2CDO7JdGH A.3952@TK2MSFTN GP04.phx.gbl...[color=blue]
    > How obtain the current record ? this is my code:
    >
    > Dim fila As DataRow
    >
    > Dim llaveprimaria(0 ) As DataColumn
    >
    > llaveprimaria(0 ) = dasedo.Tables(" tabest").Column s("codigo")
    >
    > dasedo.Tables(" tabest").Primar yKey() = llaveprimaria
    >
    > fila = dasedo.Tables(" tabest").Rows.F ind(c_idfind)
    >
    > Me.BindingConte xt(dasedo, "tabest").Posit ion = 1 (bad code line help me
    > please)
    >
    >[/color]


    Comment

    • Cor Ligthert [MVP]

      #3
      Re: actual record

      Jose,

      Please don't start new threads about the same question.

      This is not a 10 second answer newsgroup.

      Thanks in advance.

      Cor

      "Jose" <josenospam@uni ca.com> schreef in bericht
      news:e2CDO7JdGH A.3952@TK2MSFTN GP04.phx.gbl...[color=blue]
      > How obtain the current record ? this is my code:
      >
      > Dim fila As DataRow
      >
      > Dim llaveprimaria(0 ) As DataColumn
      >
      > llaveprimaria(0 ) = dasedo.Tables(" tabest").Column s("codigo")
      >
      > dasedo.Tables(" tabest").Primar yKey() = llaveprimaria
      >
      > fila = dasedo.Tables(" tabest").Rows.F ind(c_idfind)
      >
      > Me.BindingConte xt(dasedo, "tabest").Posit ion = 1 (bad code line help me
      > please)
      >
      >[/color]


      Comment

      • Jose

        #4
        Re: actual record

        Cor this link has problems? I don´t access.


        "Cor Ligthert [MVP]" <notmyfirstname @planet.nl> escribió en el mensaje
        news:eoC4C9MdGH A.1324@TK2MSFTN GP04.phx.gbl...[color=blue]
        > Jose,
        >
        > Have a look at this sample where your problem is done.
        >
        > There is as well your next problem in it.
        >
        > http://www.vb-tips.com/default.aspx?...9-4deb7fa4a0b8
        >
        >
        > I hope this helps,
        >
        > Cor
        >
        > "Jose" <josenospam@uni ca.com> schreef in bericht
        > news:e2CDO7JdGH A.3952@TK2MSFTN GP04.phx.gbl...[color=green]
        >> How obtain the current record ? this is my code:
        >>
        >> Dim fila As DataRow
        >>
        >> Dim llaveprimaria(0 ) As DataColumn
        >>
        >> llaveprimaria(0 ) = dasedo.Tables(" tabest").Column s("codigo")
        >>
        >> dasedo.Tables(" tabest").Primar yKey() = llaveprimaria
        >>
        >> fila = dasedo.Tables(" tabest").Rows.F ind(c_idfind)
        >>
        >> Me.BindingConte xt(dasedo, "tabest").Posit ion = 1 (bad code line help me
        >> please)
        >>
        >>[/color]
        >
        >[/color]


        Comment

        • Cor Ligthert [MVP]

          #5
          Re: actual record

          Jose,

          We are changing thanks for telling this to us.

          Here the tip as it is there.

          \\\\
          Controls Databinding (Textbox), given is here a kind of standard routine for
          a textbox and a datatable datetime column, the sample needs only a form with
          a textbox and two buttons dragged on it (The sample is based on VB2005
          style. For VB2002/2003 you have remove the Import, the Public Class Form1
          and the End Class and paste it than in)
          --------------------------------------------------------------------------------

          Imports System.data
          Public Class Form1
          Dim ds As New DataSet
          Private Sub Form1_Load(ByVa l sender As System.Object, _
          ByVal e As System.EventArg s) Handles MyBase.Load
          Dim dt As New DataTable
          ds.Tables.Add(d t)
          dt.Columns.Add( "DateField" , GetType(System. DateTime))
          Dim Mybinding As New Binding("Text", ds.Tables(0), "DateField" )
          TextBox1.DataBi ndings.Add(Mybi nding)
          AddHandler Mybinding.Forma t, AddressOf DBdateTextbox
          AddHandler Mybinding.Parse , AddressOf TextBoxDBdate
          dt.LoadDataRow( New Object() {New DateTime(2005, 8, 4)}, True)
          dt.LoadDataRow( New Object() {Nothing}, True)
          dt.LoadDataRow( New Object() {New DateTime(2005, 8, 5)}, True)
          End Sub
          Private Sub Button1_Click(B yVal sender As System.Object, _
          ByVal e As System.EventArg s) Handles Button1.Click
          'forward
          If BindingContext( ds.Tables(0)).P osition _
          < ds.Tables(0).Ro ws.Count Then
          BindingContext( ds.Tables(0)).P osition += 1
          End If
          End Sub
          Private Sub Button2_Click(B yVal sender As System.Object, _
          ByVal e As System.EventArg s) Handles Button2.Click
          'backward
          If BindingContext( ds.Tables(0)).P osition > 0 Then
          BindingContext( ds.Tables(0)).P osition -= 1
          End If
          End Sub
          Private Sub DBdateTextbox(B yVal sender As Object, _
          ByVal cevent As ConvertEventArg s)
          If cevent.Value Is DBNull.Value Then
          cevent.Value = ""
          Else
          Dim datum As Date
          datum = CDate(cevent.Va lue)
          cevent.Value = datum.ToString( "d")
          End If
          End Sub
          Private Sub TextBoxDBdate(B yVal sender As Object, _
          ByVal cevent As ConvertEventArg s)
          If cevent.Value.To String = "" Then
          cevent.Value = DBNull.Value
          Else
          Dim datum As Date
          datum = CDate(cevent.Va lue)
          cevent.Value = datum
          End If
          End Sub
          End Class

          I hope this helps,

          cor


          "Jose" <josenospam@uni ca.com> schreef in bericht
          news:%23zDSInOd GHA.1320@TK2MSF TNGP04.phx.gbl. ..[color=blue]
          > Cor this link has problems? I don´t access.
          >
          >
          > "Cor Ligthert [MVP]" <notmyfirstname @planet.nl> escribió en el mensaje
          > news:eoC4C9MdGH A.1324@TK2MSFTN GP04.phx.gbl...[color=green]
          >> Jose,
          >>
          >> Have a look at this sample where your problem is done.
          >>
          >> There is as well your next problem in it.
          >>
          >> http://www.vb-tips.com/default.aspx?...9-4deb7fa4a0b8
          >>
          >>
          >> I hope this helps,
          >>
          >> Cor
          >>
          >> "Jose" <josenospam@uni ca.com> schreef in bericht
          >> news:e2CDO7JdGH A.3952@TK2MSFTN GP04.phx.gbl...[color=darkred]
          >>> How obtain the current record ? this is my code:
          >>>
          >>> Dim fila As DataRow
          >>>
          >>> Dim llaveprimaria(0 ) As DataColumn
          >>>
          >>> llaveprimaria(0 ) = dasedo.Tables(" tabest").Column s("codigo")
          >>>
          >>> dasedo.Tables(" tabest").Primar yKey() = llaveprimaria
          >>>
          >>> fila = dasedo.Tables(" tabest").Rows.F ind(c_idfind)
          >>>
          >>> Me.BindingConte xt(dasedo, "tabest").Posit ion = 1 (bad code line help me
          >>> please)
          >>>
          >>>[/color]
          >>
          >>[/color]
          >
          >[/color]


          Comment

          Working...