Solved

C# Binary Data to integer

Posted on 2014-09-22
4
131 Views
Last Modified: 2014-09-23
I have a field in an SQL Server table.

I need to read the binary field into an integer or string variable.

Using C#

Help please.
0
Comment
Question by:Idarac
  • 2
  • 2
4 Comments
 
LVL 79

Expert Comment

by:David Johnson, CD, MVP
ID: 40337362
you have to read it as it is stored and then you can cast it into what you want.
0
 
LVL 1

Author Comment

by:Idarac
ID: 40337381
Can you give ma idea of the syntax?
0
 
LVL 79

Accepted Solution

by:
David Johnson, CD, MVP earned 500 total points
ID: 40337769
 static void Main(string[] args)
        {
            int MyInt = 32;
            string strMystring = MyInt.ToString();

            Console.WriteLine("My int = {0}",MyInt);
            Console.WriteLine("My String = {0}",strMystring);
            Console.ReadLine();

Open in new window

0
 
LVL 1

Author Closing Comment

by:Idarac
ID: 40339985
Thanx....
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now