473,385 Members | 1,901 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,385 software developers and data experts.

Loading images from dataset

Hi all :)
I have procedure:

public void czytajObraz()
{
if (datas.Tables["capsch"].Rows.Count > 0)
{
picbox.Image = null;
fig = (byte[])datas.Tables["capsch"].Rows[context[datas,
"capsch"].Position]["Fig"];
if (fig.Length > 0)
{
System.IO.MemoryStream strfig = new System.IO.MemoryStream(fig,
true);
strfig.Write(fig, 0, fig.Length);
Bitmap bmp1 = new Bitmap(strfig);
picbox.Image = bmp1; strfig.Close();
} // if (fig.Length > 0)
}
}

This void is running always when I go to next row, prior row, last or
first in dataset. When I remove data row from dataset (RemoveAt(...) or
Delete()) then I got an exception, otherwise it's work correctly. How
can I read images from dataset when I going up or down in rows?

Thanks for help, gregory.
Nov 16 '05 #1
1 5579
Hi,

What exception do you get?
What's the context[datas, "capsch"].Position in such condition?
What row are you trying to read?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"rozrabiak" <br**@maila.pl> wrote in message
news:c5**********@news.onet.pl...
Hi all :)
I have procedure:

public void czytajObraz()
{
if (datas.Tables["capsch"].Rows.Count > 0)
{
picbox.Image = null;
fig = (byte[])datas.Tables["capsch"].Rows[context[datas,
"capsch"].Position]["Fig"];
if (fig.Length > 0)
{
System.IO.MemoryStream strfig = new System.IO.MemoryStream(fig,
true);
strfig.Write(fig, 0, fig.Length);
Bitmap bmp1 = new Bitmap(strfig);
picbox.Image = bmp1; strfig.Close(); } // if (fig.Length > 0)
}
}

This void is running always when I go to next row, prior row, last or
first in dataset. When I remove data row from dataset (RemoveAt(...) or
Delete()) then I got an exception, otherwise it's work correctly. How
can I read images from dataset when I going up or down in rows?

Thanks for help, gregory.

Nov 16 '05 #2

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

Similar topics

1
by: Stacey | last post by:
Hi, I'm hoping for a bit of advise-- I have a (relatively, from the point-of-view of this dilettante) complex script that attempts to preload certain images in order to trigger one of a series of...
4
by: Adrian MacNair | last post by:
Hi, I created an image gallery which displays 63 images in a slideshow. The problem is that the show was slow because each image loaded one at a time during the show. No problem right? I just...
15
by: Geoff Cox | last post by:
Hello I have following type of code in the header function pre_load_pics() { if (document.images) { var image1 = new Image(400,265); image1.scr = "pic1.jpg";
0
by: rozrabiak | last post by:
Hi all :) I have procedure: public void czytajObraz() { if (datas.Tables.Rows.Count > 0) { picbox.Image = null; fig = (byte)datas.Tables.Rows.Position]; if (fig.Length > 0)
0
by: BATISTA | last post by:
Hi , I am working in c# with crystal report XI. I read an example about dynamic image location .. 1) In that we have a xml xchema file with two fields n amed country--datatype is string,...
4
by: VR | last post by:
Hi, I am trying to have a menu item (which is an HTML img) to change as a mouse moves over it. So, my code looks something like this: <a onmouseover="ActivateImage('MyImage');"...
2
by: Jean Pierre Daviau | last post by:
When I have something like this in a js file. listeImg = new Array(); listeImg = new Image(w,h); listeImg.src = "centre1.jpg"; etc Are the images loaded after the page is loaded? In the same...
0
by: speedcoder | last post by:
hi all, i'm stumped. my applet used to load images over the network. (it was actually designed by someone else.) yes, the applet used to load each image file independently over the network and...
1
by: agatha.life | last post by:
I did a javascript for the loading of images (I didn't want to have the images loaded in "on loading" because they are too many). The website is for a model and if you look at the codeof pages (...
1
by: mlikesit | last post by:
I am trying to get the following code to pre-load some images before re-dirrecting the user. The problem is that the onError event gets called for all of the images immediately. I've tripple...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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...

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.