|
You are asking how to turn your CSV data into CSV data?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
ROTFL - yes, now that you say that, I think perhaps you are right.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
My Magic Eight Ball says you want to Split some comma-separated values within a String . Have you searched CP for articles related to this task?
|
|
|
|
|
He does ? Wow.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
The Eight Ball don't lie.
|
|
|
|
|
Don't get me wrong, I would never doubt the power of the 8 ball....
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I remember when calling someone an 8-ball was duragatory
|
|
|
|
|
got it![^]
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Wow - that actually worked, sort of. But it gave an STL sample as first hit. Perhaps you should have put C# in there and used site: to search CP ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I remember there used to be a hidden Eight Ball in MS Access, good times. There was something hidden in most of the MS Office type applications back then; Excel had a little 3D world that you could fly around in!
My current favourite word is: Sammidge!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Hi
I have problem returning an XML document in my c# code. The code I am using is as follows:
string xmlString = null;
MemoryStream memoryStream = new MemoryStream();
XmlSerializer xs = new XmlSerializer(typeof(T));
XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.UTF8);
xs.Serialize(xmlTextWriter, obj);
memoryStream = (MemoryStream)xmlTextWriter.BaseStream;
xmlString = UTF8ByteArrayToString(memoryStream.ToArray());
return xmlString;
private static string UTF8ByteArrayToString(byte[] characters)
{
UTF8Encoding encoding = new UTF8Encoding();
string constructedString = encoding.GetString(characters);
return (constructedString);
}
The problem I have is when the xml string is returned, the namespace and declaration at the start of the xml string is not in a well formed xml document.
What it is doing is inserting / in front of the equal sign in the name space, thus:
Therefore, I am looking for advice on how to stop this happening.
Can anyone help?
Thanks
|
|
|
|
|
Your example xml header is not showing up. Maybe you need to enclose it in code tags or pre tags.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
namespace VDP{
public class GlobalVar{
Private Const _DIAMONDS As String = "♦"
public string DIAMONDS
{
get { return _DIAMONDS };
}
}
}
namespace VDP{
public partial class frmMain: Form{
Switch (x){
case globalVar.DIAMONDS:
}
error: A Constant Value is expected on this line: case globalVar.Diamonds:
Not sure where I went wrong. All I want to do is compare x to my Const DIMAONDS
|
|
|
|
|
Usually you don't copy VB.NET code into C#.
|
|
|
|
|
Thanks for the reply, however it wasn't very helpful.
My task is to convert a program that I wrote from VB to C#. I am not copying the VB directly in. I am trying to re-write the program in C#. As a complete novice, all I can do is try. Are you saying that all of my code is completely wrong?
|
|
|
|
|
yogi_bear_79 wrote: Private Const _DIAMONDS As String = "♦"
public string DIAMONDS
Try changing the above to
private const char _DIAMONDS = '♦';
public char DIAMONDS
{
...
|
|
|
|
|
Thanks, I made the suggested changes in my GlobalVar class. I now get an error on this line:
private const char _DIAMONDS = '♦';
Cannot implicitily convert type 'string' to 'char'
|
|
|
|
|
yogi_bear_79 wrote: private const char _DIAMONDS = '♦';
Cannot implicitily convert type 'string' to 'char'
This looks OK, are you sure the quote characters are definitely single quotes? If you use double quotes then the compiler thinks it's a string rather than a single character.
|
|
|
|
|
That's not really the "right" error you know, it should say "Syntax error: this is C#, not VB"
Blind suggestion (untested)
namespace VDP
{
public class GlobalVar
{
public const string DIAMONDS = "♦";
}
}
namespace VDP
{
public partial class frmMain : Form
{
switch (x)
{
case globalVar.DIAMONDS:
break;
}
}
}
Hint: the right side of a case should be an actual constant, not a "thing that is logically constant", but syntactically constant.
Good luck
|
|
|
|
|
Thanks, like I said, I am just a novice this is my first project to convert the Poker game I wrote in lesson 1 to C#.
I get the following error after following your suggestions:
Member VDP.GlobalVar.DIAMONDS cannot be accessed with an instance referance; qualify it with a type name instead
|
|
|
|
|
I tried using "♦"; in lieu of "♦"; It did not create the diamond symbol. Do I need to do something else? I had wanted to use code versus symbols on my original VB code but was unable to get it to work.
|
|
|
|
|
I don't really see what you mean here, what do you mean?
|
|
|
|
|
Sorry i typed "&9830;"; and it converted to the Diamonds symbol for me. I was trying to say I couldn't get my program to display the Diamond when I used "&9830;"
|
|
|
|
|
oh, yea, should have been \u9830 or something like that - I didn't type it on purpose, it accidentally happened, dunno why
|
|
|
|
|
Try this.........
namespace CodeSnippets
{
class Global
{
public const string strOperator = "+";
}
public class Example
{
private void Go()
{
bool i;
switch (x)
{
case Global.strOperator:
{
i = true;
break;
}
}
}
}
}
Thanks
Md. Marufuzzaman
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|