|
How i can Send ArrayList to WebMethod ? i used this code in WebService class
[WebMethod]<br />
public void getData(ArrayList DataS)<br />
{<br />
}
and send data from clinet to Web Service like this
localhost.Service BB = new localhost.Service();<br />
<br />
ArrayList dS = new ArrayList();<br />
<br />
BB.getData(ds);
this code is not work , any one can Exp this problem ?
|
|
|
|
|
Hi,
As i want to store more than a value for a single key, i am using
NameValueCollection for storing the values.
Periodically (say for every 10 seconds), i will remove the values for
further processing with
nvCollection[Key]=null;
In this case, the null is also counted as a value. How can i
eliminate this null value.
With thanks,
Sakthi.
|
|
|
|
|
To remove values for a key, use the NameValueCollection.Remove() method.
Cheers,
Vikram.
The cold will freeze our stares
We won't care...
|
|
|
|
|
Hi,
NameValueCollection.Remove() Will remove even the key .
i.e. entire key value pair will be removed.
But i want only the values to be removed retaining the key.
With Thanks,
Sakthi.
|
|
|
|
|
what do you mean by 'the null is counted as a value'?
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
u can try
if( nvCollection.Contains(key))
{
String oldkey = key;
nvCollection.Remove(key);
nvCollection.Add(oldkey,newvalue);
}
rahul
|
|
|
|
|
Hi,
I am storing data into the NameValueCollection.For every 10 seconds i
have to take the values out, for that i am using
nvc.getValues(key)
After that i am clearing the values for that key by
nvc[key]=null;
In this case null is also considered as one of the value for that
key. When i use remove, the key is also cleared.
As i want the order of the key to be preserved.i dont want to do
anything with the key.
|
|
|
|
|
Hi,
have to parse a big Textfile with about 33000 lines and at the moment this is very slow.
A colleague advised me to read the file into a buffer (byte Array) and than parse it. Thats ok, but i need the "readline" functionality.
How can i read the buffer line-by-line like the Streamreader?
I'm sure someone knows
|
|
|
|
|
I guess you could always convert the byte array into a string and then split it based on Environment.NewLine. This sounds as though it wouldn't be very performant either.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
you could use FileStream to copy the file into a MemoryStream, and later use StreamReader from MemoryStream to parse it.
<br />
FileStream fs = new FileStream("text.txt", FileMode.Open, FileAccess.Read);<br />
MemoryStream ms = new MemoryStream();<br />
<br />
byte[] buf = new byte[4096];<br />
int bytes = 0;<br />
while((bytes = fs.Read(buf, 0, 4096)) > 0) {<br />
ms.Write(buf, 0, bytes);<br />
}<br />
fs.close();<br />
<br />
StreamReader sr = new StreamReader(ms);<br />
string x = sr.ReadLine();<br />
My second computer is your linux box.
|
|
|
|
|
Hi Friend'z
I have MDI application which contains multiple forms, From Main page's main menu i have opened login form. after entering login details, i have to go to main page. i'm going to another page but login page wil not b closing. the Login form should be closed after main page is opened.
How can i do it?
pl help me friends... thanks in advance!
ITS VERY URGENT FRIEND'Z
please yar.
Raheem MA
Tr. Systems Engineer.
|
|
|
|
|
See point 1. Clickety[^]
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi!
I'm using a
ThreadPool.QueueUserWorkItem(GetData);
method to get some data (from sqldb). the GetData method is sth uses a DataAdapter object to fill untyped dataSet and returns its fitst table (Tables[0] - if != null of course)..
the problem is that the dataAdapter doesn't always fill the dataset - the table is not created when it's suppoused to be - the sql server received the querry and completed it (i checked it using profiler). well the only solution i was able to get is
<br />
int safeCt = 5;<br />
while(dataSet.Tables.Count == 0 && safeCt > 0) {<br />
try {<br />
dataAdapter.Fill(dataSet);<br />
if(dataSet.Tables.Count == 0)<br />
System.Threading.Thread.Sleep(500);<br />
} catch { }<br />
safeCt--;<br />
}<br />
for 6 out of 200 querries the fill was called twice..
well, it works, but is there any better way?!
life is study!!!
|
|
|
|
|
Doesn't the switch statement in C# support multiple options inside the case clause??? I'm sorry if I missed it.
|
|
|
|
|
No, but you can use empty case labels to achieve this. Example
switch (x)
{
case 1:
case 2:
DoOneAndTwo;
break;
}
|
|
|
|
|
blackjack2150 wrote: multiple options inside the case clause???
What do you mean?? Another switch case statement??
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
I mean something like this:
switch(DayOfWeek)
{
case "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" : work = true;
case "Saturday", "Sunday": party = true;
}
VB .NET for example has it and that's quite sad for me, as I've preferred C# over VB.
|
|
|
|
|
switch (DayOfWeek)<br />
{<br />
case DayOfWeek.Monday:<br />
case DayOfWeek.Tuesday:<br />
case DayOfWeek.Wednesday:<br />
case DayOfWeek.Thursday:<br />
case DayOfWeek.Friday:<br />
work = true;<br />
break;<br />
case DayOfWeek.Saturday:<br />
case DayOfWeek.Sunday:<br />
party = true;<br />
break;<br />
}
well, it works for me... think you may be doing something wrong
My second computer is your linux box.
|
|
|
|
|
Hi all,
I have a complicated form. I call that form from my main form and then close it.
After close I call GC.Collect() to ensure that all the memory used for the form has been removed. But it still exited.
I load sos.dll and use !dumpheap -stat command to show memory and see that my form and all controls and objects the form use still existed.
I debug for a long time, remove delegates, dispose disposable objects etc. but the form didnt' go.
So how can I know which object hold reference to the form? (they call them root reference as I remember). Any article, any tool to solve my problems.
It's critical, please help me.
Regards,
|
|
|
|
|
|
You can use memprofiler (mentioned in the other post) and you can also use the CLR Profiler[^] tool.
You really shouldn't be calling GC.Collect() yourself in any case. All this does is force a garbage collection cycle to run "out of turn", which ultimately causes more work for the GC. Whenever a collection cycle runs, your applications main thread is frozen for the duration of the cycle...so the more times you force a collection, the worse your performance will become.
Once you close the form, are you setting the variable reference to null ?
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
Hi all,
i want to show multiple colors in a single progress bar,
do we have any customized tool for this,.
thnx in advance
prashath
|
|
|
|
|
I'm afraid you're going to have to make your own progressbar class.
This article might help:
http://www.codeproject.com/cs/miscctrl/colorprogressbar.asp
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
i know its a very huge process to create a new pgbar,
but here my req needs multiple colors in a sigle pgbar, i wil be verymuch happy if u can help me to get a pgbar which satisfies my req.
thnx in advance,
prashanth
|
|
|
|
|
It's not at all a very HUGE process. If you would take a look at the source code from the article in my previous post, you'll see that nothing in there is difficult to understand, and if it is, we will be happy to clarify. No one here, not even me on a very bored day, is going to write this especially for you.
Of course if it exists you might get lucky and someone will refer you, but I think writing it is going to be faster.
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|