473,405 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Put int into SqlDbType.Binary typed parameter

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

Thanks!

Mihaly
Jan 25 '06 #1
4 3805
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]
- mv*@spam.guard.caspershouse.com

"Mihaly" <Mi****@discussions.microsoft.com> wrote in message
news:BB**********************************@microsof t.com...
I have a parameter typed SqlDbType.Binary and length 30. I can transfer to
this parameter an int value.
How can I transfer this value?

Thanks!

Mihaly

Jan 25 '06 #2
No. I try to transfer an int value in parameter with Binary(30) type.

Mihaly

"Nicholas Paldino [.NET/C# MVP]" wrote:
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]
- mv*@spam.guard.caspershouse.com

"Mihaly" <Mi****@discussions.microsoft.com> wrote in message
news:BB**********************************@microsof t.com...
I have a parameter typed SqlDbType.Binary and length 30. I can transfer to
this parameter an int value.
How can I transfer this value?

Thanks!

Mihaly


Jan 25 '06 #3
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]
- mv*@spam.guard.caspershouse.com

"Mihaly" <Mi****@discussions.microsoft.com> wrote in message
news:1D**********************************@microsof t.com...
No. I try to transfer an int value in parameter with Binary(30) type.

Mihaly

"Nicholas Paldino [.NET/C# MVP]" wrote:
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]
- mv*@spam.guard.caspershouse.com

"Mihaly" <Mi****@discussions.microsoft.com> wrote in message
news:BB**********************************@microsof t.com...
>I have a parameter typed SqlDbType.Binary and length 30. I can transfer
>to
> this parameter an int value.
> How can I transfer this value?
>
> Thanks!
>
> Mihaly


Jan 25 '06 #4
Thank you!

Mihaly

"Nicholas Paldino [.NET/C# MVP]" wrote:
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]
- mv*@spam.guard.caspershouse.com

"Mihaly" <Mi****@discussions.microsoft.com> wrote in message
news:1D**********************************@microsof t.com...
No. I try to transfer an int value in parameter with Binary(30) type.

Mihaly

"Nicholas Paldino [.NET/C# MVP]" wrote:
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]
- mv*@spam.guard.caspershouse.com

"Mihaly" <Mi****@discussions.microsoft.com> wrote in message
news:BB**********************************@microsof t.com...
>I have a parameter typed SqlDbType.Binary and length 30. I can transfer
>to
> this parameter an int value.
> How can I transfer this value?
>
> Thanks!
>
> Mihaly


Jan 25 '06 #5

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

Similar topics

3
by: David Stockwell | last post by:
Hi, I'd like to read the contents of a file into memory. The problem is that this file is binary. I then want to store the whole thing in memory to a database as a blob. I have no problem...
1
by: Ramzi Abboud | last post by:
I want to store a binary string in SqlServer from VB .NET through a stored procedure. I have been storing the binary data in a BitArray which I am not set on by any means. When I pass the...
5
by: Kenneth | last post by:
Can anyone explain me why it is neccesary to include SqlDbType to the SqlParameter. In every example I see, it is done, but no one explaines why. I have for example a date I want to save into my...
2
by: valmir cinquini | last post by:
Hi everybody I'm newbee in C# and I'm supporting an application where there's a method like following: public int addNews(DateTime dtNews, string strTitle, string strShortText, string...
1
by: studen77 | last post by:
Thanks to anyone in advance who can help :) Ok, I know this is a far stretch, but what I'm trying to do is to cast a System.object as one of the SqlDbType enumerations (SqlDbType.Int,...
2
by: adams114 | last post by:
I am having a strange problem with invalid type casts. I am trying to update a MS SQL Database with a stored procedure. When I setup the parameters collection for the command object I get a invalid...
5
by: Kevin R | last post by:
I'm trying to update a sql database. It's modified Oledb code from an example that did work with an access database. How can I tweak my code to make it work? Thanks in advance. Kevin...
21
by: Peter Bradley | last post by:
Hi all, This post is sort of tangentially related to my earlier posts on configuration files for DLLs. Does anyone know how to create typed DataSets using VS2005's new DataSet designer, but...
5
by: =?Utf-8?B?YmJkb2J1ZGR5?= | last post by:
I am having a problem converting string to binary and I am hoping someone can help me out I have a sql query that does an update that updates a binary field calles password ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.