|
Thanks For Good And Fast reply
|
|
|
|
|
How to create spaces between them???
|
|
|
|
|
qty.Text + " " + rate.Text
|
|
|
|
|
qty.Text + " " + rate.Text
|
|
|
|
|
how to use brain cells?
how to read book?
how to ask questions?
|
|
|
|
|
try declaring a string variable and pass the value of two textbox.text in the declared variable...
string strTxtVal = "";
strTxtVal = qty.Text + rate.Text;
|
|
|
|
|
Dear friends ,
I have Problem like these ...
i have C++ dll which returns "unsigned char *" - this contains image data
now i want that to be converted to c# "byte[]"
how to do that???
thank you
|
|
|
|
|
|
Dear friend
thank for the reply
and few clarification,
"unsigned char *" is a pointer array and is it possible to assign to simple char[] of c# without any address as such ??
unsigned char* buffer = new unsigned char[xSize*ySzie]; //Type in C++
byte[] ImageData =buffer; //C#
throws error as "Cannot implicitly convert type 'byte*' to 'byte[]",
do i need to change byte[] ImageData to byte[]* ImageData
Thank you
|
|
|
|
|
|
Hi,
you can't convert an unsigned char * (or any other pointer) to a byte[] or any other kind of array, as an array has a length which is not available when all you have is a pointer.
the easiest way to transfer an array of elements between managed and unmanaged worlds is by having the managed world create the array and the native side to read/write said array. Which means the array's size must be known beforehand, and the array should be passed as a parameter.
|
|
|
|
|
I have a web address which when run in a web browser returns a xml file.
i need to save that file as xml format.
i have tried using webclient.downloadfile method but its not saving the full file, it only saves two lines.
please if any one can explain how to do it.
|
|
|
|
|
Perhaps your application isn't waiting for the entire content to be downloaded?
/ravi
|
|
|
|
|
You can download web pages using the HttpWebRequest and HttpWebResponse classes. My CP Vanity[^] article holds an example in its downloadPage() method.
|
|
|
|
|
hi,
thanks for your reply,
this is my code, till the content it returns fine but does not save the file in the drive.
how do i make it to save it on the hard disk.
thanks
rssDoc = new XmlDocument();
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(value);
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
Stream stream = resp.GetResponseStream();
StreamReader reader = new StreamReader(stream, Encoding.UTF8);
string content = reader.ReadToEnd();
rssDoc.LoadXml(content);
rssDoc.Save("c:asp.xml");
|
|
|
|
|
Hi,
two comments:
1.
aforaries wrote: rssDoc.Save("c:asp.xml");
this is not correct; it needs a backslash after the colon, either insert two backslashes (as one will be ascaped) or use the @ sign:
rssDoc.Save(@"c:\asp.xml");
Furthermore, the top folder of the main partition isn't writable on modern Windows versions (Vista, 7).
2.
content contains the string you received; the easiest way to save that to a file is by using
File.WriteAllText(filespec, content);
That is also the way that assumes content is text, no more, no less; it does not require it to be valid XML; your way of doing things does require valid XML, otherwise rssDoc.LoadXml(content); will fail.
|
|
|
|
|
Hello everybody,
I develop a GMAO csharp smart device application using Visual studio 2008.I try to show my data stocked in my tables in my database .sdf.I use DataGridView tool.I add in the proprietes of my dataGridView the table i wanna show its data.My DataGridViewForm's code is:
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace ModeDifféré
{
public partial class DataGridT : Form
{
public DataGridT()
{
InitializeComponent();
}
private void DataGridT_Load(object sender, EventArgs e)
{
this.travauxTableAdapter.Fill(this.baseGmaoLocaleDataSet2.Travaux);
}
private void dataGrid1_CurrentCellChanged(object sender, EventArgs e)
{
}
}
}
But the problem is when running,an error occurs :
<pre>The column name is not valid. [ Node name (if any) = ,Column name = Effectué/Non ]
what is the problem?
Any help will be very helpful
Regards
|
|
|
|
|
We only see the partial class, so we don't see the generated code, but based on your error message, I'd revisit my column names: your column appears with two special characters : é (e accent aigu) and / (slash). Try renaming your column to something less international (Start with a letter + A combination of letters, digits and _ (underscore).)
|
|
|
|
|
Is there a way to assign a variable a series of values?
What I mean is the first time it is called it's value is 5, the second time its 9, third time its 46, fourth 152 etc
|
|
|
|
|
Well, I guess you could call it an array, or a dictionary.
Your question is vague.
A variable in and of itself won't change it's value on its own.
Are you by chance looking for a randomly generated value, or is there a pattern of numbers you want to return?
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Preset values, seemingly random but not actually random.
I think an array would probably be the way to go.
|
|
|
|
|
Wogboiii wrote: I think an array would probably be the way to go.
Not on its own, but most of the generic collections wrap an array.
|
|
|
|
|
You might try some sort of enumerator instead.
Or a Stack or a Queue.
public static class MySeries
{
private static readonly System.Collections.Generic.Queue<int> values ;
static MySeries
(
)
{
values = new System.Collections.Generic.Queue<int>
(
new int [] { 5 , 9 , 46 , 152 }
) ;
return ;
}
public static int
Next
{
get
{
return ( values.Dequeue() ) ;
}
}
}
System.Console.WriteLine ( MySeries.Next ) ;
modified on Sunday, April 25, 2010 11:57 AM
|
|
|
|
|
I don't think that would work because it needs to be assigned the value then that value is used in other functions then the next time it's called its value gets changed.
|
|
|
|
|