DataBind

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • André Almeida Maldonado

    DataBind

    How can I bind data with a DropDownList... I use a code that return no
    errors but don't populate de DropDownList... See the code:


    Dim conBanco = New
    SQLConnection(" server=(local)\ NetSDK;database =Digiexpress;In tegrated
    Security=SSPI")
    Dim cmdCommand As SqlCommand = conBanco.Create Command()

    conBanco.open()

    Dim dtrDataReader as SqlDataReader


    cmdCommand.Comm andText = "SELECT usuanome FROM usuarios"

    dtrDataReader = cmdCommand.Exec uteReader()

    drpLigaAten.Dat aSource = dtrDataReader
    drpLigaAten.Dat aBind()

    dtrDataReader.C lose()


  • Rajesh Patel

    #2
    Re: DataBind

    try to use dataset/datatable/dataview instead of datareader.

    I think, datareader does not implement ilistsource interface.

    Rajesh Patel.


    "André Almeida Maldonado" <deweb@bol.com. br> wrote in message
    news:uv$%23jJck DHA.1408@TK2MSF TNGP11.phx.gbl. ..[color=blue]
    > How can I bind data with a DropDownList... I use a code that return no
    > errors but don't populate de DropDownList... See the code:
    >
    >
    > Dim conBanco = New
    > SQLConnection(" server=(local)\ NetSDK;database =Digiexpress;In tegrated
    > Security=SSPI")
    > Dim cmdCommand As SqlCommand = conBanco.Create Command()
    >
    > conBanco.open()
    >
    > Dim dtrDataReader as SqlDataReader
    >
    >
    > cmdCommand.Comm andText = "SELECT usuanome FROM usuarios"
    >
    > dtrDataReader = cmdCommand.Exec uteReader()
    >
    > drpLigaAten.Dat aSource = dtrDataReader
    > drpLigaAten.Dat aBind()
    >
    > dtrDataReader.C lose()
    >
    >[/color]


    Comment

    • André Almeida Maldonado

      #3
      Re: DataBind

      But just for populate a DropDownList I have to create a DataSet, DataTable,
      DataView????

      This will use too much memory, doesn't it???

      Thank's...


      "Rajesh Patel" <rdp647@hotmail .com> escreveu na mensagem
      news:%2368d%23u ckDHA.1676@TK2M SFTNGP09.phx.gb l...[color=blue]
      > try to use dataset/datatable/dataview instead of datareader.
      >
      > I think, datareader does not implement ilistsource interface.
      >
      > Rajesh Patel.
      >
      >
      > "André Almeida Maldonado" <deweb@bol.com. br> wrote in message
      > news:uv$%23jJck DHA.1408@TK2MSF TNGP11.phx.gbl. ..[color=green]
      > > How can I bind data with a DropDownList... I use a code that return no
      > > errors but don't populate de DropDownList... See the code:
      > >
      > >
      > > Dim conBanco = New
      > > SQLConnection(" server=(local)\ NetSDK;database =Digiexpress;In tegrated
      > > Security=SSPI")
      > > Dim cmdCommand As SqlCommand = conBanco.Create Command()
      > >
      > > conBanco.open()
      > >
      > > Dim dtrDataReader as SqlDataReader
      > >
      > >
      > > cmdCommand.Comm andText = "SELECT usuanome FROM usuarios"
      > >
      > > dtrDataReader = cmdCommand.Exec uteReader()
      > >
      > > drpLigaAten.Dat aSource = dtrDataReader
      > > drpLigaAten.Dat aBind()
      > >
      > > dtrDataReader.C lose()
      > >
      > >[/color]
      >
      >[/color]


      Comment

      Working...