|
You can use an attribute to turn off this error. Or, you can use a worker thread which sends messages back to the main thread, whch can then update the UI.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Create a new thread while making any calls to server. Let that thread handle it. If u r using .NET 2.0, use form.InvokeRequired().
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
I am student of final year engineering student. I selected “SMS Website” as my project topic. In this I have to send Bulk SMS through website and provide other kind of services related to SMS.
Please tell me which steps I should follow.
Please send me some material or any kind of source code related to it.
I need your help.
Thank you!!!
Contact Me: ashish.0619@gmail.com
|
|
|
|
|
hi,
How to use that assembly update Version????? Pls tel me.......
Thanking you
somasundaram
|
|
|
|
|
hi,
Does any body knows how to create a new user in the active directory using the C# language.
Best regrads,
Jamil Abou Khalil
|
|
|
|
|
|
is it difficult to give the answer and make some help without being an a**hole
jamil abou khalil
|
|
|
|
|
Hello,
In one hand I do agree with you, because there are a lot of ironic answers in this forum.
But,
jamil abou khalil wrote: being an a**hole
This is much too rude.
Martin
|
|
|
|
|
And the is even not the first time, he insulted me at the beginning this week, because I said something about his 'posting the question over and over again because no answer was given'...
|
|
|
|
|
Hahahahahah
Please don't cry
jamil abou khalil
|
|
|
|
|
Search[^]
"My advice to you is to get married. If you find a good wife, you will be happy; if not, you will become a philosopher." Socrates
|
|
|
|
|
thank you
jamil abou khalil
|
|
|
|
|
you are welcome...
"My advice to you is to get married. If you find a good wife, you will be happy; if not, you will become a philosopher." Socrates
|
|
|
|
|
What? No snappy comeback or vulgarity for telling you to search?
only two letters away from being an asset
|
|
|
|
|
hi i am loading 500000 records in to a datatable and going thro each and every record. It is taking a large amount of time .
Is there any possibility or efficient ways in which we can handle it easily....less memory resouse utilization is must plzzzz
help me........
thanks.....
|
|
|
|
|
Where is the data being loaded from? Why are you loading some much? What do you mean, "going thro each and every record"? Lots of unanswered questions here.
only two letters away from being an asset
|
|
|
|
|
i am making a connection to a text file thro ODBC connectivity and filling the datatable.... tht txt file may contain records from 5000 to 500000+
i need to loop thro each record and do some processing...?
|
|
|
|
|
chandler83 wrote: filling the datatable
Do you mean the table in the database or DataTable object?
only two letters away from being an asset
|
|
|
|
|
You should prepare your data ( do the loop ) then process it to the DB all at once, or at least in batches. One DB call per record will indeed take forever.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
you can use paging to minimize the mount of data you are retrieving , or if you are searching then maybe you can do that process on the SQL Server side or whatever you are using...
|
|
|
|
|
I had to update/insert a couple of 1000's records once. What I did was concatenate the inserts (delimit with ";") and fire it up to the database at once...
eg.
"INSERT INTO YOURTABLE (COLNAMES) VALUES (COLVALUES);INSERT INTO YOURTABLE (COLNAMES) VALUES (COLVALUES);...;INSERT INTO YOURTABLE (COLNAMES) VALUES (COLVALUES);"
In your case don't do it at once, but in blocks.
Hope this helps.
V.
No hurries, no worries
|
|
|
|
|
Please help to run following code(c#) from msdn(url==>http://msdn.microsoft.com/msdnmag/issues/04/12/ServiceStation/default.aspx)
//the code is
using System;
using System.Web;
using System.Web.Hosting;
using System.Net;
using System.IO;
...
class Program
{
static void Main(string[] args)
{
//error occurs at this line,error message is given below
MySimpleHost msh = (MySimpleHost)
ApplicationHost.CreateApplicationHost(
typeof(MySimpleHost), "/", Directory.GetCurrentDirectory());
HttpListener listener = new HttpListener();
listener.Prefixes.Add("http://localhost:8081/");
listener.Prefixes.Add("http://127.0.0.1:8081/");
listener.Start();
Console.WriteLine(
"Listening for requests on http://localhost:8081/");
while (true)
{
HttpListenerContext ctx = listener.GetContext();
string page = ctx.Request.Url.LocalPath.Replace("/", "");
string query = ctx.Request.Url.Query.Replace("?", "");
Console.WriteLine("Received request for {0}?{1}",
page, query);
StreamWriter sw = new
StreamWriter(ctx.Response.OutputStream);
msh.ProcessRequest(page, query, sw);
sw.Flush();
ctx.Response.Close();
}
}
}
public class MySimpleHost : MarshalByRefObject
{
public void ProcessRequest(string p, string q, TextWriter tw)
{
SimpleWorkerRequest swr = new SimpleWorkerRequest(p, q, tw);
HttpRuntime.ProcessRequest(swr);
}
}
when I run the code the compiler shows following error message
Could not load file or assembly 'wserver, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
What should I put in /bin directory?
Should I add assembly in GAC?
Thanks
tandukar
|
|
|
|
|
What version of .NET ? Why don't you have IIS ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I've been programming under the assumption that taking a lock out on an object will get an exclusive lock out, so no other thread can enter any region that uses the same object as a lock.
i.e.
<br />
void Read()<br />
{<br />
lock(obj)<br />
{<br />
}<br />
}<br />
<br />
void Write(data)<br />
{<br />
lock(obj)<br />
{<br />
}<br />
}<br />
Now i was thinking that a synronous call to Read and Write would lock 'obj' and prevent two threads from
doing different things at the same time.
However, while debugging an app (That i had tested with numerous multi threaded scenarios and had no problems), i found that i could have a breakpoint in Read and a breakpoint in write, and they would hit alternatively, while there was still logic to be executed in both blocks. This has made me wonder whether i'm totaly wrong about the whole locking mechanism and whether a lock is only obtained for a particular region of code, rather than the object itself.
Alternativly, could this be an issue with Debugging and stepping through multi threaded apps?
Can anyone shed any light on the subject please?
Cheers
Tristan RHodes
|
|
|
|
|
The Catalyst wrote: Now i was thinking that a synronous call to Read and Write would lock 'obj' and prevent two threads from
doing different things at the same time.
That's correct. Only one thread can be running the code inside Read/Write at any point in time (assuming they're sharing the locked object obj )
The Catalyst wrote: However, while debugging an app (That i had tested with numerous multi threaded scenarios and had no problems), i found that i could have a breakpoint in Read and a breakpoint in write, and they would hit alternatively, while there was still logic to be executed in both blocks.
Where did you put the breakpoint? The breakpoint would hit the lock statement, but would block if you try to execute the thread.
The Catalyst wrote: whether a lock is only obtained for a particular region of code, rather than the object itself.
Now that's confusing. The lock does not lock the object passed to the lock statement, it only uses the object as a kind of token to indicate the thing this thread should lock on.
|
|
|
|