 |

|
Not if he wants the name to stay whole (which I assume to be the case). That [what Sledge suggests] seems like a bad idea in general.
modified 27 Dec '12 - 18:37.
|
|
|
|

|
Your assumption is correct. Needed the whole name. To get it done, I changed the delimiter in the data from a comma to a tilde. It worked users are happy for the moment.
(Edit) Part of the conversion process is breaking the name apart into first name last name
Common sense is admitting there is cause and effect and that you can exert some control over what you understand.
|
|
|
|

|
I don't get it. You have a string as "Last Name, First Name" and you want Last Name, First Name without the quotes? Then just strip off the quotes. There is no need to use the split function. Since you want to break the name apart, my solution is actually correct. Remove the quotes, then split based on the comma.
|
|
|
|

|
No, that's just one of the fields. Check out some troublesome data:
id,name,location,phone
1,"Smith, John","Anytown, USA",123-4567
2,William "The Refrigerator" Perry,The Gridiron,000-0000
3,Madonna,"Los Feliz, Los Angeles, CA",555-5555
Not to say that the OP has such problems with which to deal, but some do.
modified 27 Dec '12 - 22:19.
|
|
|
|

|
I don't recall seeing that in the original post. I went back and re-read it, and if that is what the OP had intended, its a very poorly worded question . In this case, I'd:
string[] parts = Split(',')
foreach (string in parts)
Replace("\"", "");
Personally, parts 1 and 2 need special comma handling and parts 0 and 3 don't.
If I wanted to get sophisticated, I believe you can use datasets to parse something like that for you, but I'd just do what I said above... split on the commas, strip off the quotes and then process the 4 fields.
|
|
|
|

|
William "The Refrigerator" Perry and Madonna say that's a bad idea.
Without more knowledge of the data, the only proper way to handle this is to split on the delimiters while honoring the quotes.
Replace is rarely an appropriate tool.
|
|
|
|

|
SledgeHammer01 wrote: its a very poorly worded question
Those are some of the lines I've become better at reading between. If it were that simple, the question wouldn't have been asked (by this particular asker).
|
|
|
|

|
Oh, NM... I see his issue now.
|
|
|
|

|
This is actually what I would've done too - it's seems simpler.
But then there are also multiple fields involved.
|
|
|
|

|
Is it possible to debug into C# source code using WinDbg 6.12.0002.633?
I read on the internet that this is not possible with 6.12.0002.633. On 32 bit Win7, I am able to set breakpoint into C# source file, but the breakpoint does not showup in red.
One of the link says that it is possible to debug into C# source code only with WinDbg 6.7.05.0.
I did not download .Net framework source code.
I need to debug on a 64 bit Win 7 OS. Did not try yet on Win 7 64 bit as I was not able to debug into C# code on 32 bit version itself using WinDbg.
Thanks,
Sharath
modified 28 Dec '12 - 0:43.
|
|
|
|

|
I hv written following code to show text on tab click in google map now alone with text in pop up window i want to give link as well how to give that?
code is....
GooglePoint GP4= new GooglePoint();
GP4.ID = "4";
GP4.Latitude = 28.496193;
GP4.Longitude = 77.096595;
GP4.InfoHTML = "This is pointing to Building 6 Tower C NIL Labs Ground Floor";
//HtmlAnchor GP5= default(HtmlAnchor);
//GP5.HRef = "http://www.google.com/";
//how to give link to open web page along with " this is pointing to buildin...." text shown in above code.
|
|
|
|

|
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously.
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|

|
i want to add link to my tab pop up to open any web page on click of it as i have to use HTMLanchor tag how to use it in following code to give link with text
GooglePoint GP4= new GooglePoint();
GP4.ID = "4";
GP4.Latitude = 28.496193;
GP4.Longitude = 77.096595;
GP4.InfoHTML = "This is pointing to Building 6 Tower C NIL Labs Ground Floor";//here with this tab i want to give a link like "www.google.com",this is aspx.cs page code
//HtmlAnchor GP5= default(HtmlAnchor);
//GP5.HRef = "http://www.nil-labs.com/";
|
|
|
|

|
Is it possible to implement tcp server inside .net web application
|
|
|
|

|
Yes, but why would you want to?
It's better off as it's own seperate application.
|
|
|
|

|
Actually i have devices(client) which communicate through tcp with server(C# desktop app).What i want is to access the server and control the devices(client) through web.
|
|
|
|

|
OK??? You're still going to have to write a seperate server application. It's not a good idea to implement a TCP server inside a web app.
|
|
|
|

|
thanks for the suggestion Dave .
|
|
|
|

|
I suppose you could. Personally, I have not done it. But from what I gather based on the above - it probably would not be beneficial.
|
|
|
|

|
thanks, now i ' m planning to write a separate web app.
|
|
|
|

|
As in below artical i had been try to get info from another computer;
Collecting Remote System Information With WMI[^]
However, i had created class Systeminfo and followed the steps infact i had embed the provided source and run my script but received error (Object reference not set to an instance of an object.)
|
|
|
|

|
Huh, too bad. Sure wish we could see your code so we could help.
|
|
|
|

|
here is my script;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Globalization;
namespace Computer_system
{
public partial class Form1 : Form
{
private RemoteSysInformation.SystemInformation sysinfo;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (sysinfo.Get("textBox4.text") != 0)
{
MessageBox.Show("Error getting system information.", "System Information");
}
else
{
textBox3.Text = ("" + Computer_system.win32_computer_system.GetDomain());
textBox2.Text = ("" + Computer_system.win32_computer_system.GetUserName());
textBox1.Text = ("" + Computer_system.win32_computer_system.GetPSComputerName());
textBox5.Text = ("" + Computer_system.win32_computer_system.GetManufacturer());
textBox6.Text = ("" + Computer_system.win32_computer_system.GetModel());
listBox1.Text = ("" + Computer_system.win32_printer.GetName());
}
}
private void button4_Click(object sender, EventArgs e)
{
Process.Start("Cmd.exe", @"/C mstsc.exe /v:");
}
private void button2_Click(object sender, EventArgs e)
{
Process.Start("Cmd.exe", @"/C RC.exe 1");
}
private void button3_Click(object sender, EventArgs e)
{
Process.Start("Cmd.exe", @"/C MSRA.exe /OfferRA");
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
|
|
|
|

|
Among other things, it appears you don't instantiate the sysinfo.
Run it in the debugger, step through, and see where (else) the problem is.
And what's with the "" + ?
|
|
|
|

|
i do run debug and received below
Object reference not set to an instance of an object
|
|
|
|

|
Yes, but where? Which statement caused it?
|
|
|
|

|
if (sysinfo.Get("textBox4.text") != 0)
|
|
|
|

|
Just as I thought. You need to initialize sysinfo.
|
|
|
|

|
how do i initialize sysinfo
|
|
|
|
|

|
You SERIOUSLY need to pickup a beginners book on C# an d work through it.
If your code, you need to add the line:
sysinfo = new SysInfo();
to the Form_Load method.
SERIOUSLY, pickup a book! You desperately need it.
|
|
|
|

|
i had refer but unfortunate fail.
Dear Exprt,
Would mine to guide to archive this on button.
|
|
|
|
|

|
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
public partial class Templates_Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Bitmap myBitmap = new Bitmap("D:\\WebSite1\\image\\egy111.jpg");
Graphics g = Graphics.FromImage(myBitmap);
g.DrawString("My\nText", new Font("Tahoma", 1000), Brushes.Red, new PointF(340,500));
}
}
why this code don't work in web application
|
|
|
|

|
Meh..
- Your subject-line does not give me a clue about the problem;
- Don't post your mail-address unless you "need" spam
- "Does not work" doesn't explain anything. Include the full error-message
- Read up on the
Dispose-method
It does not work because the webserver isn't allowed to read from your D-drive using the current credentials.
|
|
|
|

|
Because it's a web application, not a Windows application. Add a reference to System.Drawing.dll, and this code will compile.
In some cases, my signature will be longer then my message...
<em style="color:red">ProgramFOX</em> ProgramFOX
|
|
|
|

|
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
public partial class Templates_Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Bitmap myBitmap = new Bitmap("D:\\WebSite1\\image\\egy111.jpg");
Graphics g = Graphics.FromImage(myBitmap);
g.DrawString("My\nText", new Font("Tahoma", 1000), Brushes.Red, new PointF(340,500));
}
}
why this code don't work in web application
|
|
|
|

|
and don't post the same friggin' question twice, unless you want me to repeat the answer.
|
|
|
|

|
Hi Everone,
I´m looking for a implementantion or a code or even a Tip to implement one Autocomplete (intellisense) like visual studio. For example:
If you tipe DT in caps letters in visual Studio they suggest DateTime and any other item wich contains D in begining and T in the middle. in capital letter. It´s amazing, I really want to put this in a WindowsForms application.
Thanks in advance!
|
|
|
|

|
I don't know that it is possible like you specified (D******T***). But it is possible doing auto complete for Da******.
Refer this Link[^]
|
|
|
|

|
Thanks Sirama, I´m thiking here, I could try to search if the letter is upper case, like D%T%...
I will try this later, thanks.
|
|
|
|

|
private static final java.text.Collator COLLATOR = java.text.Collator.getInstance();
private static final String[] NORM_STRINGS = new String['z' - 'a' + 1];
{
COLLATOR.setStrength(Collator.PRIMARY);
for (char b = 'a'; b <= 'z'; b++)
{
NORM_STRINGS[b - 'a'] = new String(new char[] { b });
}
}
|
|
|
|

|
Repost from Java forum[^]
Please post a question in one forum.
In some cases, my signature will be longer then my message...
<em style="color:red">ProgramFOX</em> ProgramFOX
|
|
|
|

|
Hi, I have tried all sorts of help provided over the internet and couldn't manage to populate the wpf datagridcomboboxcolumn with collection of values from arraylist.
Following is my code:
XAML:
<DataGridComboBoxColumn Header="Rooms" Width="*" ItemsSource="{Binding Path=SwitchesList}" SelectedItemBinding="{Binding Path=room}" ></DataGridComboBoxColumn>
CODE BEHIND:
private ArrayList arrSwitches;
public ArrayList SwitchesList
{
get { return arrSwitches; }
set
{
arrSwitches = adb.getSwitchList(switchtype);
}
};
What am I doing wrong here?
Thanks in advance.
|
|
|
|

|
Member 9678427 wrote: What am I doing wrong here?
..assuming that it'll be filled, because the getter is called. It will not be initialized, unless "set". This should have been a read-only property, initialized in the constructor.
|
|
|
|

|
can you tell the code for converting speech to text using csharp .net?
|
|
|
|

|
Take your pick[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|

|
Hi,
I have a word file. And I am trying to modify the content of this file by using C# (via Microsoft.Office.Interop.Word).
For example: My file includes the below lines:
"Full name: ....
Address: ....
City: .... "
And, I want to change the "full name" and "city" to :
"Full name: John Markery
Address: ....
City: London"
How can I do that ?
Thanks and regards,
|
|
|
|
|
 |