|
until now i don't have an idea because it's my first time to use it, can't you tell me how to do about "LENGTH"?????
|
|
|
|
|
yes, I can.
Read a book.
I'm serious. You're lacking some basic knowledge, hence you don't understand what people are telling you.
If you cannot grasp the notion of a Length property of an array, contacting databases is way over your head.
Read a book and start from scratch. Create a "hello world" program and work your way up.
|
|
|
|
|
Then you should have said that you had no idea what how to use the debugger LONG before this.
|
|
|
|
|
Open the code file and click on the line that assigns the bytea array. Press F9 and you should see a red circle appear to the left of the code line - this is a breakpoint (to remove it, press F9 on that line again). Press F5 to run your application in debug mode and trigger the bit of code that populates your image. Step over the line of code by pressing F10. Right click on the variable btpht and select QuickWatch from the popup menu. You should see btpht in the Expression. To see the value, either expand the variable in the listview below or type btpht.Length in the expression and click Reevaluate.
|
|
|
|
|
please, my english is not good,
look at here
int c = ds.Tables["client"].Rows.Count;
if (c > 0)
{
Byte[] btpht = new Byte[0];
btpht = (Byte[])(ds.Tables["client"].Rows[c - 1]["photo"]);
MemoryStream phtosssss = new MemoryStream(btpht);
pictureBox1.Image = Image.FromStream(phtosssss);
try to bring correction please i have tried but, no error message with the following code , but no picture posted in my picture box
int c = ds.Tables["client"].Rows.Count;
if (c > 0)
{
Byte[] btpht = new Byte[0];
btpht = (Byte[])(ds.Tables["client"].Rows[c - 1]["photo"]);
MemoryStream phtosssss = new MemoryStream(btpht.Length);
pictureBox1.Image = Image.FromStream(phtosssss);
|
|
|
|
|
MINDONGO wrote: MemoryStream phtosssss = new MemoryStream(btpht.Length); No. You should have left this as
MemoryStream phtosssss = new MemoryStream(btpht); All we want is for you to tell us what the Length is. I told you exactly which buttons to press to debug your application. You should have followed those exactly.
|
|
|
|
|
this is the message "Quote: parameter is not valid "
about the length, i created my data base in ACESS, and the type was OLE OBJET, no length specified in case of in access
|
|
|
|
|
Are you even reading my replies? Okay, the simple answer is, you aren't populating the byte array which is why the image is not being displayed. The reason you aren't populating it is because the type is an OLE Object. Basically, this could contain any type of OLE data, so you need to determine what the image was originally stored as and then manually parse the OLE object. Given your inability to follow simple instructions on debugging an application, I would suggest that doing this task will be well beyond you.
If it's meant to be an image format, then store it as an IMAGE datatype in the database and your code should then work.
|
|
|
|
|
by doing what you have told me, i found [0] or zero as the value of btpht.length
modified 1-Apr-14 11:11am.
|
|
|
|
|
MINDONGO wrote: and i have used OLE object in my image data
Since you don't seem to be willing to do anything to help us assist you, I've had to engage me psychic debugging powers, which leads me to the following conclusion:
Your database field doesn't contain a raw stream of image bytes. Instead, it contains an OLE wrapper object[^], which the Image.FromStream method cannot understand. If you can't change how the images are stored in the database, then you'll need to find some code to remove that wrapper to get the raw image bytes back. There's a good example here[^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
for the time beeing, i found zero, as btpth.length
|
|
|
|
|
for the moment, the current value btpht as {byte [8]}
|
|
|
|
|
Jquery Easy UI DataGrid not show after publish to IIS using c# MVC 5. How to solve.
My code is ,
$(document).ready(function () {
var urlStr = '@Url.Content("~/Admin/UserView")';
$('#tt').datagrid({
url: urlStr,
striped: true,
singleSelect: true,
columns: [[
{ field: 'USER_ID', title: 'User ID', width: 150 },
{ field: 'USER_NAME', title: 'User Name', width: 200, align: 'left' },
{
field: 'Action', title: 'Action', width: 100,
formatter: function (value, row, index) {
console.log(row);
return 'Select';
}
}
]],
onClickRow: function (idx, data) {
console.log(data);
}
});
|
|
|
|
|
That's JavaScript. This is the C# forum.
|
|
|
|
|
Hi,
I am developing an application with c#. And for that I want to create bill report in my project. Can anyone give some example code or any reference please.
|
|
|
|
|
|
Crystal Reports bleh - disgusting application, I would use SQL Server Reporting Services SSRS local report, no server required and it is not CR.
There are many reporting tools available but they are all add ons to the application, you can embed them in the app or they may be server based so you need to do some research into which meets your requirements.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hello,
I am at my wits end and was hoping for some help if possible.
I have been asked to retrieve some data from a SOAP/XML webservice. No problem I thought, done that loads of times.
I was even given a working PHP example that returns the data I need - even easier I thought!
BUT, in my c# code I cannot get past authorisation!
This is the example PHP script that works perfectly...
<?php
try
{
$soap_url = "http://108-168-196-91.mycitrixdemo.net/zdm/services/EveryWanDevice?wsdl";
$client = new SoapClient(null, array(
'location' => $soap_url,
'uri' => "http://zdemo2.zenprise.com",
'login' => "Administrator",
'password'=> "xxxxx"));
$properties=$client->getDeviceProperties("99000067296308",null);
for($i=0;$i<count($properties);$i++) {
printf ("name: %s, value: %s\n" , $properties[$i]->name, $properties[$i]->value);
}
}
catch (Exception $e)
{
print_r($e); exit;
}
?>
I tried passing the username and password as I have done before like this:
ClassLibrary1.trev.DeviceServiceService test = new trev.DeviceServiceService();
test.Credentials = new System.Net.NetworkCredential("Administrator", "xxxx", "citrix");
test.getAllDevices();
And I get "Failed to Authenticate
Reading the documents it says...
Quote: Service Authentication
2nd generation SOAP services provide WS-Security (<https: www.oasis-open.org="" committees="" wss="">)
support using WSS4J (<http: ws.apache.org="" wss4j="">). By default, the services require WSS
Username+Password authentication of a valid user with the required rights. Support for other WSS
features might be added in future releases.
NOTE: these services DO NOT use HTTP authentication, as the previous Device Manager web services
So, I then tried:
EveryWan.DeviceServiceService service = new EveryWan.DeviceServiceService();
UsernameToken userToken = new UsernameToken("Administrator", "xxxx", PasswordOption.SendPlainText);
service.RequestSoapContext.Security.Tokens.Add(userToken);
service.RequestSoapContext.Security.Elements.Add(new MessageSignature(userToken));
And still I get "Failed to Authenticate"
I just don't understand what I need to do to talk to this API?
The PHP works fine! but I cannot replicate it in c#.
Can anyone see what I am doing wrong please?
Any help would be much appreciated!
Thanks
|
|
|
|
|
can you get in contact with webservice supplier?
I've contacted a zen webservice once from .Net, but was in luck I was in touch with the supplier. They looked in their logs and figured out some issues between the zen framework and the .Net way of doing things. Then they modified it and it worked.
I'm not sure what those issues were though, it had to do with the wsdl, headers, protocols and standards etc...
(this might not be an issue in this case, I don't know, but it might give you a lead)
hope this helps.
|
|
|
|
|
That sounds very like it could be the case.
Luckily I have contact with the Zen people..
I will ask.
Thanks V!!!
|
|
|
|
|
Did you have to do anything special with your code?
Or, did you just code it as a normal "Add Web Reference"?
Thanks
Trev
|
|
|
|
|
add webservice.
I suppose you could program it against the wsdl directly, but if you can, don't go down that road.
|
|
|
|
|
We are working on a project in which we want to replace small part of a image with another small part of same size image at given coordinate
|
|
|
|
|
I am sure you will learn a great deal about images in implementing this project.
Is there something we can help you with ?
If there is, please tell us what you've done so far; if you are having difficulty, post excerpts of your code to show where any errors occur, and describe the error messages that appear.
If you are stuck, then describe what your goals are, and show the code of what you have tried so far.
“Use the word 'cybernetics,' Norbert, because nobody knows what it means. This will always put you at an advantage in arguments.” Claude Shannon (Information Theory scientist): letter to Norbert Weiner of M.I.T., circa 1940
|
|
|
|
|