.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Santhakumar Munuswamy
Asad Ali
Fauzul Azmi
Post New Web Links

Binary Counting

Posted By:      Posted Date: October 24, 2010    Points: 0   Category :ASP.Net

Hello Seniors My Data Structure Is Like This

USERID(PK)               LEFT                RIGHT

001                    |                      |      002   

002                    |        003        |      004     

003                    |        005        |          

004                    |                  &nb

View Complete Post

More Related Resource Links

Cutting Edge: Binary Serialization of DataSets


The ADO. NET DataSet object plays an essential role in most of today's distributed, multitiered applications. Instances of the DataSet class are used to move data across the tiers and to exchange data with external services.

Dino Esposito

MSDN Magazine October 2004

Web Q&A: Who Called the Script?, Concatenating Binary Files, and More


This month find out which part of an HTML document has called a script, how to concatenate binary files, find a node, reference one script from another, build a GUI database front end in Access, and compare XML files.

Edited by Nancy Michell

MSDN Magazine August 2003

Cutting Edge: Binary Serialization of ADO.NET Objects


One of the key elements that makes ADO. NET superior to ADO is the level of integration with XML. In ADO, XML is just an I/O format. In addition, the ADO XML format is totally inflexible and doesn't allow any type of customization.

Dino Esposito

MSDN Magazine December 2002

Help ~~ How to Update Binary Image on Formview

Hi All ~~ I'm confused, Can i have some help please... Thanks
Database: Books
uid dataType uniqueidentifier
Cover dataType image 
aspx :
 <asp:FormView ID="FormView1" runat="server" BackColor="LightGoldenrodYellow"   BorderColor="Tan" BorderWidth="1px" CellPadding="2" DataKeyNames="uid"     DataSourceID="SqlDataSource1" ForeColor="Black" Width="525px">
         <table class="table_width">
                 <td class="imageWidth">
                     <asp:Image ID="Image1" runat="server" Height="245px" 
                                       ImageUrl='<%# IIF(Eval("Cover") Is DbNull.Value, "~/Styles/Global/CFZ-No-Images.png", Eval("uid", "~/ImageServices.ashx?BooksID={0}")) %>' Width="180px" />

Is this an example of binary serialization


Hi , I have write this code for write error message in .txt file and this code is working fine.

void writeToLogFile(string logMessage)


        string strLogMessage = string.Empty;

        string strLogFile = System.Configuration.ConfigurationManager.AppSettings["logFilePath"].ToString();

        StreamWriter swLog;

        strLogMessage = string.Format("{0}: {1}", DateTime.Now, logMessage);

        if (!File.Exists(strLogFile))


            swLog = new StreamWriter(strLogFile);




            swLog = File.AppendText(strLogFile);






I want to know is this an example of binary serialization? 
If YES then please inform me from which line the serialization is done? 
If NO then please tell me an example of Binary Serialization ?

Create excel file from Binary data on SqlServer



My requirement is that i upload an excel file then i need to validate that data.


1. Uploading file using using upload control saving binary in SqlServer

2. Then i am creating file from binary data  on Sql Server using below command and then using OPENROWSET to dump data to Sql table

3. Then reading Sql Table row wise and validating data.


Alter Procedure spUploadExcelFile
  @PKID int,
  @BatchID int


	Declare @VarBin varbinary(max)
	Declare @FileName varchar(100)
	DECLARE @sql nvarchar(MAX)
                DECLARE @errMsg nvarchar(MAX)
	DECLARE @ObjectReturn INT
	DECLARE @ErrorSource VARCHAR(255)
	DECLARE @ErrorDesc VARCHAR(255)
	DECLARE @ObjectToken INT

	Select @VarBin  = Content , @FileName = [FileName] from MultilangBinaryData Where PKID = @PKID
	SET @FileName = 'C:\'  + @FileName
	EXEC sp_OACreate 'ADODB.Stream' @ObjectToken OUTPUT
	EXEC sp_OASetProperty @ObjectToken, 'Type', 1
	EXEC sp_OAMethod @ObjectToken, 'Open'
	EXEC sp_OAMethod @ObjectToken, 'Write', NULL, @VarBin
	EXEC sp_OAMethod @ObjectToken, 'SaveToFile', NULL, @FileName, 2
	EXEC sp_OAMethod @ObjectToken, 'Close'
	EXEC sp_OADestroy @ObjectToken  
	SET @sql = 'INSERT INTO dbo.UserBulkData SELECT 0,NULL,'+ @BatchI

Problem with passing an Image as binary through web service



I have a web service that is accessed by a windows forms application and receives updates like facility name, address, image etc. Everything works fine except the image data is not being passed to the windows app. I am saving the images in database on both sides, so when I pull it from the server I use the following code

if (!reader.IsDBNull(floorPlanOrdinal))

facility.FloorPlan = (byte[])reader["FloorPlan"];

I can see the facility.FloorPlan Dimentions as 103840 when I debug this method which means that the data is pulled from the database fine.

On the forms side though the dimentions become 0, all other values pass fine except this. Here is the facility property in the web service on server side.

using System;

using System

binary serialize weird error

i got this class, when i wanna serialize it, i keep getting error System.Runtime.Serialization.SerializationException was unhandled by user code   Message=Type 'System.Linq.Enumerable+WhereSelectListIterator`2[[Data.Models],[System.Int32, mscorlib, Version=, ...' in Assembly 'System.Core, Version=, ... is not marked as serializable. [Serializable] public class XXX : ... { public IEnumerable<int> CardFilters { get; set; } //public void RequeryCardFilters() //{ //} public void RequeryCardFilters() { this.CardFilters = null; ... //IEnumerable<Data.Models> var rslt = RFDataViewModelFactory.GetReportCardFilters(this.Identifiers, this.PostcodeFrom, this.PostcodeTo, this.LastContactBefore, this.RecontactBy, this.SelectedCardType); ... IEnumerable<int> rsltIds = from i in rslt select i.Id; } } you can see inside the RequeryCardFilters(), i only play with 3 data/var, 1 of them is local public prop, the other 2 are local var. If you remark this out, and just use an empty method, it worked fine. what can cause the serialization to fail? IFormatter formatter = new BinaryFormatter(); MemoryStream memStrem = new MemoryStream(); formatter.Serialize(memStrem, myObj);

Why binary annotations?

Hello, I've noticed that text annotations are stored in the .dtsx file in a binary format. e.g. I just created an empty package and added a single annotation on the control flow surface "test" and this is what ended up in the .dtsx file:   &lt;ddscontrol controlprogid="MSDDS.Text" left="13864" top="5212" logicalid="3" controlid="3" masterid="0" hint1="0" hint2="0" width="6000" height="1500" noresize="0" nomove="0" nodefaultattachpoints="1" autodrag="0" usedefaultiddshape="1" selectable="1" showselectionhandles="1" allownudging="1" isannotation="0" dontautolayout="1" groupcollapsed="0" tabstop="1" visible="1" snaptogrid="0"&gt;     &lt;control&gt;       &lt;ddsxmlobjectstreaminitwrapper binary="0002000070170000dc0500000300640000000500008008000080000000002a0001000000900144420100065461686f6d610400740065007300740000000000 " /&gt;     &lt;/control&gt;     &lt;layoutobject&gt;       &lt;ddsxmlobj /&gt;     &lt;/layoutobject&gt;     &lt;shap

How to store binary data as nvarchar(max)?

I’m trying to store a blob of binary data as nvarchar(max) and it gets truncated after just a few bytes. I wonder why and how can I prevent it. I don’t use varbinary(max) because I’m trying to keep existing DB schema intact. Current DB contains a huge chunks of text in nvarchar(max) column and I’m trying to compress (zip) this text and store it back to the same field to reduce DB size.   DB is accessed using Sync Framework (and Entity Framework) on the client side, so actual DB engine is SQL Server Compact 3.5 SP2   Thank you! KonstantinThank you! Konstantin

does anyone know why is this not working a clock that keeps on counting , it just stays the same whe

i read something about <div tag does anyone know how this is suppose to workany help is welcome, thank you ALSO if i want to do a countdown session timerwill it pretty much be the same thing?  <html> <head> <title></title> <body onload> <form> <script type="text/JavaScript"> <!-- function display() { var d = new Date(); var time = d.getHours(); var time2 = d.getMinutes(); var time3 = d.getSeconds(); document.write(time); document.write(" :"); document.write(time2); document.write(" :"); document.write(time3); alert("hi"); } // --> </script> <input type="button" OnClick="display()" value="Click Me!"/> </form> </body> </head> </html>  

Insert/Update OLE Attachment(Binary datatype) using SQL server 2000

Hi All, In the same senario how we can Insert/Update OLE Attachment(Binary datatype)  from one source table to other destination table by using SQL Server 2000 not with C# fronend code. Appreciated if you can give fix on this regads, Divakar.

Convert Binary/varbinary(8) to something readable

I have a table that stores a company id as binary(8) when I try to convert that field into something readable. I seem to get strange results. I tried the following code: select company_id,convert(int,company_id) --->if there is a dash "-" in the number it only gives me the number to the right of dash select company_id,convert(varchar,company_id)  ---> gives me a blank field Thanks in advance for any help I recieve.

How to load binary file asynchronously

I need to be able to download file from local disk or UNC path asynchronously. I've tried to use FileStream, but not sure what is the best way to read file by small chunks and combine them together then. Btw, does it make sense to download file by small chunks? Here is what I tried: byte[] _content; void Start(){ FileInfo fi = new FileInfo(path); if(fi.Exists) { FileStream fs = new FileStream(path, FileMode.Open); var stateObject = new State(fs, fi.Length); fs.BeginRead(stateObject.Buffer, 0, (int)stateObject.BufferSize, new AsyncCallback(EndReadCallback), stateObject); } } ... public void EndReadCallback(IAsyncResult asyncResult) { State state = (State)asyncResult.AsyncState; int readCount = state.FStream.EndRead(asyncResult); //store bytes inside class instance this._content = state.Buffer; //close stream state.FStream.Close(); if(FileLoaded != null) { FileLoaded.Invoke(_content); } } Thanks in advance, Paul.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend