473,407 Members | 2,314 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,407 software developers and data experts.

Class little dude...

Hi to all...

I have a class with this properties:

private int id
private byte[] file

public int ID
{
get{return id;}
set{id=value;}
}
public byte[] File
{
get{return file;}
set{file=value;}
}

When i instance the object i can obtain the Id from database but i would
like to know how to fill (from binary field in Sql server) the property File,
and how to fill from the Property to Sql Server binary field in Sql database.
Thanks
Regards.
Josema
Nov 16 '05 #1
1 1041
Hi Josema,

For filling the byte array you can use DataReader with CommandBehaviour set
to SequentialAccess and using the GetBytes method, read the contents of the
binary field in SQL Server and assign to the File property.

For more information look at this article which explains in detail how to go
about Read/Write BLOB fields in SQL Server.

<http://www.akadia.com/services/dotnet_read_write_blob.html>

HTH

Regards,
Madhu
MVP - C# | MCSD.NET

"Josema" wrote:
Hi to all...

I have a class with this properties:

private int id
private byte[] file

public int ID
{
get{return id;}
set{id=value;}
}
public byte[] File
{
get{return file;}
set{file=value;}
}

When i instance the object i can obtain the Id from database but i would
like to know how to fill (from binary field in Sql server) the property File,
and how to fill from the Property to Sql Server binary field in Sql database.
Thanks
Regards.
Josema

Nov 16 '05 #2

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

Similar topics

32
by: Will Hartung | last post by:
Can someone clarify that multiple classes in the "class" attribute are ok and "legal" and not some fluke? So, I can do: ..pink {color: pink} ..bold {font-weight: bold} ..medium {font-size:...
9
by: Jon Wilson | last post by:
I have a class which needs to accumulate data. The way we get this data is by calling a member function which returns float on a number of different objects of different type (they are all the...
6
by: Marco Segurini | last post by:
Hi, I have a class with some member-functions. I should like to have a way to add a non-static-member-variabile to the class that be visible by only one member function. TIA Marco.
11
by: cyberdave | last post by:
Someone please help me! I have a template class like this: -------------------------------------------------- template<typename T> class List { public:
3
by: Jeff Carver | last post by:
I'm creating a class (using VB.NET) that must read data from a database table during instantiation. If the data cannot be read (connection problem, etc.), I want the instantiation to fail such...
12
by: Dave A | last post by:
I have a class that does not have a default constructor. The nature of the class inherently excludes it from having one and to put one in will blatantly misrepresent the object that it is modelling....
16
by: Java script Dude | last post by:
Creating a method of object (Object.prototype.classOf ...) is not the correct way because of a (as expected) flaw in IE where DOM Elements does not inherit from Object. As a result it is best to...
102
by: BoogieWithStu22 | last post by:
I am running into a problem with a web page I have created when viewing it in IE6 on some machines. The page has a database lookup. The user enters an account name or number and clicks a lookup...
3
by: Duggi | last post by:
Hello, I have a class with an indexer in the class. The code code is in C#. However I was trying to access the indexer in the other lang of .Net, VB. I ran into some indexer related issues (I...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.