|
|
How would i get to the end of an item in a string array?
I have :
string[] test;
test[5] has the data that i want and the data looks something like
"This is a test at My house".
I am trying to get to the end of this string and get the last word.
So i try to use Length like this
int start = test[5].IndexOf("My")+2;
int end = test[5].Length;
string MyString = test[5].Substring (start, end);
I build fine but when i run, it blows up saying string out of bounds.
Anyone know how i should be doing this and maybe why this does not work?
Thanks,
|
|
|
|
|
Sorry, i figured it out...
I need to do a Substring for start, (end-start)
|
|
|
|
|
Hi,
Can i drag items from listboxes to elsewhere?
Thx,
Nuno
|
|
|
|
|
If you write the code to do so, yes.
|
|
|
|
|
hi,
i created an application which connects to the remote gatewawy and retrieve call information through telnet and save them to the database..
to connect using telnet i used the opensource classs given in below link
http://csharp-source.net/open-source/network-clients/dot-net-telnet[^]
but the problem i find is when the data is pulled for the first time it pulls out all data at once where for example to call datas comes as 1 string or 1 call data comes as 2 strings..but after that when it monitors new calls it record them correctly.
is there any solutions for this plz do help me..
aneef
|
|
|
|
|
It may help if you post a question in a support forum dedicated to the product.
There is a forum here: https://sourceforge.net/forum/forum.php?forum_id=184705
Maybe you should try posting your question there?
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
View my Blog
|
|
|
|
|
Hi,
How can i change the name of a listbox element?
i was trying something like
listbox[index].Name = "blahblah" but is not allowed
i also tried listbox.Items[index].Name = "blahblah" but it doesnt work either.
How can i do this?
Thx,
Nuno
|
|
|
|
|
What does the Name property denote ? It doesn't seem to me like something you need to change.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
DO you really want to change the name or the text contained therein?
If text try the following
listbox[index].Text = "blahblah";
.Name is the name of the control.
Mike
You can do anything you want but you pay for everything you do!
|
|
|
|
|
Yes, i want to change the Text.
But it doesnt work as you suggested as well...
<br />
Error 1 Cannot apply indexing with [] to an expression of type 'System.Windows.Forms.ListBox' Coordinator.cs 810 21 Coordinator<br />
I need to change this test because i'm using a listbox to store some entities, and i want to rename those entities if i want, and the name of them in the listbox must change also.
Nuno
|
|
|
|
|
Yes your right do this
listbox.Items[index] = "blahblah";
Since a ListBox only uses strings the above should work.
Mike
You can do anything you want but you pay for everything you do!
|
|
|
|
|
Good Morning,
i have a problem!
i'd like to filter a dataset but return one dataset object and no one datarow object.
ex: DataRow[] dRow = dslocation.Tables[0].Select("text <> 'Any'");
i dont want it.
Please help me!
Thanks a lot!
|
|
|
|
|
You need to use a DataView. So something like:
DataView dv = dslocation.Tables[0].DefaultView;
dv.RowFilter = "Text <> 'Any'"
The rows of the DataView will exclude any row has a column text that matches 'Any'.
Hope that helps.
Ben
|
|
|
|
|
Thanks a lot, but i'd like to put this filters rows in dataset again, only filters rows.
thanks again!
|
|
|
|
|
Hi there,
Im sitting with some weird problem here, ok here goes:
Well i have a queries application and users select files from
a folder list and adds them to a customer they searched for.
The file they selected the file path with a subject and note gets saved
to the database.
Problem is that some times the exact same file path, subject and note gets
inserted twice into the database and some times 3 times.
I have searched line by line to find any possibility that the insert function runs more than ones
but it doesnt. the user select a file then enters a subject and note and then presses the capture button and the data gets inserted. My prodecure only gets executed once and it executes fast so there is no time to maybe click the button twice and even if they did i have a confirm box first before it executes the insert function.
Does anyone know what the problem might be? Pls
If you need any more info or code just lemme know.
Im programming in VS2005 C# and its a web application.
Thanks
|
|
|
|
|
Well, either the code is being called more than once, or there's a trigger on the database that also runs and does an insert. There is no other possible explantion, unless there's something weird in the SQL itself that can cause it to double insert, but that seems unlikely.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
A regular insert query doesn't add multiple records. The code is executed more than once, and the probable cause is that a user manages to send multiple requests.
Regardless of how fast the response time is, there is almost always a possibility to click the submit button more than once. After the page has been posted to the server, the page remains in the browser until the response comes from the server.
Put a script in the page that stops it from being posted more than once:
<script type="text/javascript">
var stopped = false;
</script>
<input type="submit" onclick="var s=stopped;stopped=true;return s;" />
---
single minded; short sighted; long gone;
|
|
|
|
|
How can I add this script to my page when I already
have the button click event from server side in the
onClick event in my asp code?
Am not very familiar with adding javascript code within a
server side C#/ASP.Net web application.
Thanks
|
|
|
|
|
Use the OnClientClick property.
---
single minded; short sighted; long gone;
|
|
|
|
|
I do like hardware interfacing through the USB port in Visual C # .Net before that I have interfacing to the Parallel & Serial port……but I think USB is too different .I don’t know that the how many numbers of bits in the USB ? and what is the disadvantages and advantages over the Parallel & Serial Ports? And what is reason behind the using of USB port? Can I get input from the USB and How?
I just want generate the 8-Bits signal through the USB in Visual C# .Net, like 00110010.
Please explain me and tell the some link related to the USB interfacing.
. Thanks!
|
|
|
|
|
How could I know, that a New mail is arrived in the account using POP3.
I m taking help of Pop3MailClient[^] article
Is there any POP3 command which will tell me that X number of New mails have arrived.
Please guide me.
"If our Mind can, the Program can !!"
|
|
|
|
|
i have encoded a string to ascii code like this
string s="123456*123456";<br />
byte[] sByte=Encoding.ASCII.GetBytes(s);
and i need to decode the sByte back to s string... i don't know how
need help please
|
|
|
|
|
string s = Encoding.ASCII.GetString(sByte);
|
|
|
|
|