select stmt

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

    #1

    select stmt

    In asp.net ,in command button script ,
    How can i select and assign a value into a variable from a table.like
    select ref into @var1 from table1 where id='1';
    --
    Thanks
  • Cor Ligthert [MVP]

    #2
    Re: select stmt

    Shif,

    The way your qeustion is made, gives often many misunderstandin gs, what kind
    of table do you mean?

    In the way you show it is it a DataBase table and by intance not a
    datatable.

    Cor

    "shif" <ns_0001@hotmai l.comschreef in bericht
    news:D6A99033-C328-4551-9839-37C3D62D6051@mi crosoft.com...
    In asp.net ,in command button script ,
    How can i select and assign a value into a variable from a table.like
    select ref into @var1 from table1 where id='1';
    --
    Thanks

    Comment

    • shif

      #3
      Re: select stmt

      HI
      Its a database table,
      Dim comd As New SqlCommand()
      comd.CommandTex t = "select barcode,ref from prod where supp_ref='" &
      refBox.Text & "'"
      this is an example which i am getting datainto a datatable and here records
      are more,its working fine. now i want to get barcode,ref from the same table
      and want to assign the values to two variables and only one record will fetch
      at a time.
      --
      Thanks


      "Cor Ligthert [MVP]" wrote:
      Shif,
      >
      The way your qeustion is made, gives often many misunderstandin gs, what kind
      of table do you mean?
      >
      In the way you show it is it a DataBase table and by intance not a
      datatable.
      >
      Cor
      >
      "shif" <ns_0001@hotmai l.comschreef in bericht
      news:D6A99033-C328-4551-9839-37C3D62D6051@mi crosoft.com...
      In asp.net ,in command button script ,
      How can i select and assign a value into a variable from a table.like
      select ref into @var1 from table1 where id='1';
      --
      Thanks
      >
      >
      >

      Comment

      • Cor Ligthert [MVP]

        #4
        Re: select stmt

        Shif,

        A very simple one,


        I hope this helps,

        Cor

        "shif" <ns_0001@hotmai l.comschreef in bericht
        news:F70D888D-7608-4A42-B684-530B9014232E@mi crosoft.com...
        HI
        Its a database table,
        Dim comd As New SqlCommand()
        comd.CommandTex t = "select barcode,ref from prod where supp_ref='" &
        refBox.Text & "'"
        this is an example which i am getting datainto a datatable and here
        records
        are more,its working fine. now i want to get barcode,ref from the same
        table
        and want to assign the values to two variables and only one record will
        fetch
        at a time.
        --
        Thanks
        >
        >
        "Cor Ligthert [MVP]" wrote:
        >
        >Shif,
        >>
        >The way your qeustion is made, gives often many misunderstandin gs, what
        >kind
        >of table do you mean?
        >>
        >In the way you show it is it a DataBase table and by intance not a
        >datatable.
        >>
        >Cor
        >>
        >"shif" <ns_0001@hotmai l.comschreef in bericht
        >news:D6A9903 3-C328-4551-9839-37C3D62D6051@mi crosoft.com...
        In asp.net ,in command button script ,
        How can i select and assign a value into a variable from a table.like
        select ref into @var1 from table1 where id='1';
        --
        Thanks
        >>
        >>
        >>

        Comment

        Working...