|
Djavid j wrote: <--------------HERE has the error to do
What error? You don't think we need to see the error message to help?
Do you know what the result of your SQL command is?
|
|
|
|
|
u can read the error clearly in my post...bud here again: the parameter is not valid
|
|
|
|
|
Djavid j wrote: u can read the error clearly in my post
My bad, I missed it.
That indicates that the data parameter you are giving to Image.FromStream() is not valid image data. I cannot determine why as there could be many reasons, here are a few:
The data is not stored in the database correctly
The query did not return a result
The code is not dealing with the query result correctly (casting it to a byte[]).
|
|
|
|
|
it's okay, thanx for the quick response.
i don't know wheater the image data is correctly saved, cause i see in the column res_photo only this: <binary data=""> . bud i know for sure that other data is correctly saved and the query returns also a result, i tested by resturning the res_id by a messagebox.
and whether the code is not dealing with the query result, i have no idea.
|
|
|
|
|
I think using ExecuteScalar() might be the problem, a byte[] might not be supported.
|
|
|
|
|
|
Hi, sorry if I have missed or not read all of your Tab Articles, but I never see a example of maybe doing the paste/copy command when a user is allowed to create their own tabs with text boxes in them. Since they are in a array under the name of newRtb it gets confusing how to allow the user to lets say paste information on a selected tab with a Rich Text Box in it.
Any suggestions on what to do? I do have code, but it does not work...
private void Cut(object sender, System.EventArgs e)
{
int index = this.Controls.IndexOfKey("newRtb");
if (index != -1)
{
Control control = this.Controls[index];
RichTextBox richTextBox = control as RichTextBox;
if (richTextBox != null)
{
richTextBox.Cut();
}
}
}
I am completely lost on how to do this and this is the only thing stopping me from finishing my program I made.
Thanks, Ajm113
-- modified at 12:04 Wednesday 10th October, 2007
|
|
|
|
|
Hi!
When I try to serialize a object that has a TimeSpan property that property is serialized as if it is null even if it was set.
Can anyone help me?
Thanks,
Lukas
|
|
|
|
|
Are you using the XmlSerializer? If so, then check this[^] out.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
|
See my reply to that thread.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Hi,
I have to following nagging problem. I have a normal form where i put at runtime a usercontrol. This usercontrol has a property called RE_ID. when adding the usercontrol to the form
<br />
usxClientDetail objControl = new usxClientDetail();<br />
objControl.Dock = DockStyle.Fill;<br />
this.tabPage1.Controls.Add(objControl);<br />
<br />
i would like to call that property so the usercontrol gets filled with the correct data. But there is no way i can access that
<br />
<br />
foreach (UserControl ctrl in tabPage1.Controls)<br />
{<br />
if (ctrl.Name == "usxClientDetail")<br />
{<br />
foreach (Control ct in ctrl.Controls)<br />
{<br />
MessageBox.Show(ct.Name.ToString());<br />
}<br />
}<br />
}<br />
i can loop through everything but not through the propertycollection. At least it seams ...
any ideas suggestions how to access that public property on the form at runtime is welcome :->
Kind regards,
Marcel Vreuls
http://www.marcelvreuls.com
< >
|
|
|
|
|
You can use the "is" keyword and cast it to the appropriate type, like so:
foreach (UserControl ctrl in tabPage1.Controls) {
if (ctrl is usxClientDetail) {
usxClientDetail clientDetail = ctrl as usxClientDetail;
}
}
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Thanks that works. I costed me 2 hours today en asking at CP 5 minutes ..
again thnx.....
Kind regards,
Marcel Vreuls
http://www.marcelvreuls.com
< >
|
|
|
|
|
Hi friends
I wrote follow code to send an image in network:
<br />
BinaryWriter myBR = new BinaryWriter(MyNetworkStream);<br />
myPic.Save(MyMemoryStream, System.Drawing.Imaging.ImageFormat.Jpeg);<br />
byte[] arrImage;<br />
arrImage = MyMemoryStream.GetBuffer();<br />
myBR.Write(arrImage);<br />
And this for receive it:
<br />
MemoryStream memstr = new MemoryStream();<br />
byte pic;<br />
BinaryReader br = new BinaryReader(myNetworkStream);<br />
bool loop = true;<br />
while (loop)<br />
{<br />
try<br />
{<br />
pic= br.ReadByte();<br />
memstr.WriteByte(part);<br />
}<br />
finally<br />
{<br />
loop = false;<br />
}<br />
}<br />
byte[] picture = memstr.GetBuffer();<br />
but in receive part, when it arrive to "pic = br.ReadByte();", it do no thing and there is no error.
can you tell me what is incorrect code?
|
|
|
|
|
Maybe I'm not understanding your problem, but why are you using a binary reader? Just use myNetworkStream.ReadByte()
|
|
|
|
|
An array of bytes is not represented the same way as individual bytes by the BinaryWriter. You can't write the data as an array and read it as individual bytes.
Why are you using a BinaryWriter and BinaryReader at all? Why not write and read the data directly?
---
single minded; short sighted; long gone;
|
|
|
|
|
Your loop existsexits on the first loop every time. Finally is always executed after a try block. What you intended was likely catch{loop = false;} but you need a different understanding of streams, instead.
byte[] bytes = new byte[255;]
while((bytesRead = stream.ReadBytes(bytes, 0, bytes.Length)) != 0)
otherStream.Write(bytes, 0, bytesRead);
is a better construct for copying a stream to another. (255 is arbitrary)
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Dear gurus,
is it possible to download the complete net-framework-3.0-sdk from anywhere (e.g. as a zip-file)?
If I try to download it from micrsoft, than I only get a small "setup.exe". This one seems to start some downloads by itself in background during installation.
In advance:
Thanks for your advices
|
|
|
|
|
On this[^] page under Instructions you can download the redistributable packages that contains the entire framework instead of just a bootstrapper.
|
|
|
|
|
Thanks for your help!
The site you recommended contains only the redistributable package. It is not the complete SDK.
Is there also any site?
Thanks !
|
|
|
|
|
Here?[^] Click the "Continue" button next to "validation required" and a DVD image file will become available for download in the Instructions section - if your Windows validates properly. Is that what you're looking for?
|
|
|
|
|
Hallo,
yes it is what I was looking for.
With kind regards
and thank you
|
|
|
|
|
Hi,
I have some win form application - and on the Form i have some UserControl that i wrote -
On the Form i define some button to be as "AcceptButton" ( button of the Form and not the button that is on the userControl ).
Now ... when the form is up i always get one of the userControl button as the "AcceptButton" and not the button that i define.
This happen only on one of the userControl - other userControl work fine.
What to do ?
Thanks for any help.
|
|
|
|
|
hi all
In my application, i have a treeview consisting of some nodes. when i click a node, i am generating some images
and displaying them in a listview.
i am storing the images temporarily in a folder in the application path.
so everytime a node is clicked,
i need to remove the original images and add the new images.
when i tried to delete the contents of the folder, it says file is in use(which is obvious).
Can anybody suggest me ideas as how to remove the old images from the folder?
Thanks in advance.
Regards
Anuradha
|
|
|
|