Put int into SqlDbType.Binary typed parameter

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

    Put int into SqlDbType.Binary typed parameter

    I have a parameter typed SqlDbType.Binar y and length 30. I can transfer to
    this parameter an int value.
    How can I transfer this value?

    Thanks!

    Mihaly
  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Put int into SqlDbType.Binar y typed parameter

    Mihaly,

    I don't know how you can transfer it into an int. I mean, you have 30
    bytes, and an int is only 4. What are you trying to do?


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "Mihaly" <Mihaly@discuss ions.microsoft. com> wrote in message
    news:BB66BFD7-B988-4EE5-8456-D0C3DE5C205E@mi crosoft.com...[color=blue]
    >I have a parameter typed SqlDbType.Binar y and length 30. I can transfer to
    > this parameter an int value.
    > How can I transfer this value?
    >
    > Thanks!
    >
    > Mihaly[/color]


    Comment

    • Mihaly

      #3
      Re: Put int into SqlDbType.Binar y typed parameter

      No. I try to transfer an int value in parameter with Binary(30) type.

      Mihaly

      "Nicholas Paldino [.NET/C# MVP]" wrote:
      [color=blue]
      > Mihaly,
      >
      > I don't know how you can transfer it into an int. I mean, you have 30
      > bytes, and an int is only 4. What are you trying to do?
      >
      >
      > --
      > - Nicholas Paldino [.NET/C# MVP]
      > - mvp@spam.guard. caspershouse.co m
      >
      > "Mihaly" <Mihaly@discuss ions.microsoft. com> wrote in message
      > news:BB66BFD7-B988-4EE5-8456-D0C3DE5C205E@mi crosoft.com...[color=green]
      > >I have a parameter typed SqlDbType.Binar y and length 30. I can transfer to
      > > this parameter an int value.
      > > How can I transfer this value?
      > >
      > > Thanks!
      > >
      > > Mihaly[/color]
      >
      >
      >[/color]

      Comment

      • Nicholas Paldino [.NET/C# MVP]

        #4
        Re: Put int into SqlDbType.Binar y typed parameter

        Mihaly,

        Well, you would have to create a byte array to pass. You can populate
        this byte array by using the static GetBytes method on the BitConverter
        class.

        Hope this helps.


        --
        - Nicholas Paldino [.NET/C# MVP]
        - mvp@spam.guard. caspershouse.co m

        "Mihaly" <Mihaly@discuss ions.microsoft. com> wrote in message
        news:1D4447C2-0139-470F-9C3B-4ABC0DEF931A@mi crosoft.com...[color=blue]
        > No. I try to transfer an int value in parameter with Binary(30) type.
        >
        > Mihaly
        >
        > "Nicholas Paldino [.NET/C# MVP]" wrote:
        >[color=green]
        >> Mihaly,
        >>
        >> I don't know how you can transfer it into an int. I mean, you have
        >> 30
        >> bytes, and an int is only 4. What are you trying to do?
        >>
        >>
        >> --
        >> - Nicholas Paldino [.NET/C# MVP]
        >> - mvp@spam.guard. caspershouse.co m
        >>
        >> "Mihaly" <Mihaly@discuss ions.microsoft. com> wrote in message
        >> news:BB66BFD7-B988-4EE5-8456-D0C3DE5C205E@mi crosoft.com...[color=darkred]
        >> >I have a parameter typed SqlDbType.Binar y and length 30. I can transfer
        >> >to
        >> > this parameter an int value.
        >> > How can I transfer this value?
        >> >
        >> > Thanks!
        >> >
        >> > Mihaly[/color]
        >>
        >>
        >>[/color][/color]


        Comment

        • Mihaly

          #5
          Re: Put int into SqlDbType.Binar y typed parameter

          Thank you!

          Mihaly

          "Nicholas Paldino [.NET/C# MVP]" wrote:
          [color=blue]
          > Mihaly,
          >
          > Well, you would have to create a byte array to pass. You can populate
          > this byte array by using the static GetBytes method on the BitConverter
          > class.
          >
          > Hope this helps.
          >
          >
          > --
          > - Nicholas Paldino [.NET/C# MVP]
          > - mvp@spam.guard. caspershouse.co m
          >
          > "Mihaly" <Mihaly@discuss ions.microsoft. com> wrote in message
          > news:1D4447C2-0139-470F-9C3B-4ABC0DEF931A@mi crosoft.com...[color=green]
          > > No. I try to transfer an int value in parameter with Binary(30) type.
          > >
          > > Mihaly
          > >
          > > "Nicholas Paldino [.NET/C# MVP]" wrote:
          > >[color=darkred]
          > >> Mihaly,
          > >>
          > >> I don't know how you can transfer it into an int. I mean, you have
          > >> 30
          > >> bytes, and an int is only 4. What are you trying to do?
          > >>
          > >>
          > >> --
          > >> - Nicholas Paldino [.NET/C# MVP]
          > >> - mvp@spam.guard. caspershouse.co m
          > >>
          > >> "Mihaly" <Mihaly@discuss ions.microsoft. com> wrote in message
          > >> news:BB66BFD7-B988-4EE5-8456-D0C3DE5C205E@mi crosoft.com...
          > >> >I have a parameter typed SqlDbType.Binar y and length 30. I can transfer
          > >> >to
          > >> > this parameter an int value.
          > >> > How can I transfer this value?
          > >> >
          > >> > Thanks!
          > >> >
          > >> > Mihaly
          > >>
          > >>
          > >>[/color][/color]
          >
          >
          >[/color]

          Comment

          Working...