|
hi all,when i try to access my application(which contain nearly 1000 records) it raise this error message
"timeout expired.timeout period elapsed prior to completion of the operation or the server is not responding"
i dont know what is this prob and why this is happening...any idea.....?
Regards,
ayyp
-- modified at 9:31 Friday 7th July, 2006
|
|
|
|
|
Ok, you're using .NET remoting or sockets? If you're trying to bring over 1000 records in a single call, chances are it's timing out; it gives up after some period of time.
Instead of trying to bring over all 1000 records in a single call, serialize your records into a stream, then send that stream over byte-by-byte. This will be faster, more performant, and more scalable. You also shouldn't get any timeouts this way provided you don't try to stream too many bytes per call. Try streaming 65000 bytes per call, that's 65k and should work alright on high speed connections.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Messianic Instrumentals (with audio)
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
sorry,i dont know how to do this can u send any sample code,.......that will help me.........plz.....
Regards,
ayyp
|
|
|
|
|
I have a DataView that contain multiple rows. It has a column say ColumnX that contains values composed of one or more words.
When i pass a multi-word value(one composed of two or more words) to the Find() method of the DataView for search in ColumnX, it just returns me the index of the row where a first word is matched in the ColumnX.
For example:
string searchvalue="Lossy Gray";
int index=dv.Find((object)searchword);
it return index of the row where a match for "Lossy" is found event though thre is row with "Lossy Gray".
I want only index of that row where all words are matched.
Thanks
|
|
|
|
|
How to disable "X" button at the top right of winform ?
Thanks...
|
|
|
|
|
|
Depend on how you would like for it to behave
1. Handle form closing event, set e.Cancel to true Or
2. Use Win32 API
<br />
const int SC_CLOSE = 0xF060;<br />
const int MF_BYCOMMAND = 0x0;<br />
<br />
[System.Runtime.InteropServices.DllImport("user32.dll")]<br />
public static extern IntPtr RemoveMenu(IntPtr menuHwnd, int position, int flags );<br />
<br />
public static void EnableApplicationClose( System.Windows.Forms.Form form, bool val )<br />
{<br />
IntPtr menu = GetSystemMenu( form.Handle, val ? 1 : 0 );<br />
if ( !val && menu != IntPtr.Zero )<br />
RemoveMenu( menu, SC_CLOSE, MF_BYCOMMAND );<br />
else<br />
{<br />
form.Enabled = false;<br />
form.Enabled = true;<br />
} <br />
}<br />
<br />
[System.Runtime.InteropServices.DllImport("user32.dll")]<br />
public static extern IntPtr GetSystemMenu(IntPtr hwnd, int bRevert);
Jup
-- modified at 9:03 Friday 7th July, 2006
|
|
|
|
|
Hi,
I am getting the above mentioned error while excuting the following simple example ( relating to dispose and finalize). Exact output is also attached after the program.
Can any body explain me the cause for this?
Thanks a lot in advance
//#PROGRAM
using System;
namespace test
{
//Base.cs
public class Base : IDisposable
{
private bool disposed = false;
private readonly int id;
public int ID
{
get
{
return id;
}
}
public Base(int theID)
{
id = theID;
}
public void Disp()
{
Console.WriteLine("You can run me after disposing{0}",id);
}
protected virtual void Dispose(bool disposing)
{
if (!disposed)
{
if (disposing)
{
Console.WriteLine("Base Cleaning up managed resources on {0}",id);
// Code to clean up managed resources
}
Console.WriteLine("Base Cleaning up unmanaged resources on {0}", id);
// Code to clean up unmanaged resources
}
disposed = true;
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
~Base()
{
//Following line gives error for object 2
Console.WriteLine("*** Finalize called on Base {0}", id);
Dispose(false);
}
}
//Derived.cs
public class Derived : test.Base
{
private bool disposed = false;
public Derived(int theID) : base(theID) {}
protected override void Dispose(bool disposing)
{
if (!disposed)
{
try
{
if (disposing)
{
Console.WriteLine("Derived Cleaning up managed resources");
// Code to clean up managed resources
}
Console.WriteLine("Derived Cleaning up unmanaged resources");
// Code to clean up unmanaged resources
}
finally
{
base.Dispose(disposing);
}
}
disposed = true;
}
}
//Test.cs
class Test
{
[STAThread]
static void Main(string[] args)
{
Derived object1 = new Derived(1);
Derived object2 = new Derived(2);
object1.Dispose();
}
}
}
//#OUTPUT
Derived Cleaning up managed resources
Derived Cleaning up unmanaged resources
Base Cleaning up managed resources on 1
Base Cleaning up unmanaged resources on 1
An unhandled exception of type 'System.ObjectDisposedException' occurred in mscorlib.dll
Additional information: Cannot write to a closed TextWriter.
Unhandled Exception: System.ObjectDisposedException: Cannot write to a closed TextWriter.
at System.IO.__Error.WriterClosed()
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at System.IO.StreamWriter.Write(Char[] buffer, Int32 index, Int32 count)
at System.IO.TextWriter.WriteLine(String value)
at System.IO.TextWriter.WriteLine(String format, Object arg0)
at System.IO.SyncTextWriter.WriteLine(String format, Object arg0)
at System.Console.WriteLine(String format, Object arg0)
at test.Base.Dispose(Boolean disposing)
at test.Derived.Dispose(Boolean disposing)
at test.Base.Finalize()The program '[3476] test.exe' has exited with code 0 (0x0).
Note that if you comment the lines relating object1, the program runs fine without any exception.
//#OUTPUT WHEN line 1 & 3 are commented in Main()
Derived Cleaning up unmanaged resources
Base Cleaning up unmanaged resources on 2
techno_adi
|
|
|
|
|
Is the console being routed somewhere else? Writing to the console is causing an issue, an ObjectDisposedException, as if the console itself was disposed.
Is the application exiting or something when you're writing to the console? If this is a console application, try adding a Console.ReadLine() at the end of your Main method. That way it won't exit until you press a key.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Messianic Instrumentals (with audio)
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
|
I have tried putting Console.ReadLine(), but the error remains the same
And yes i am sorry for that ill-formatted code..
i'll remember to put
next time..
-- modified at 0:46 Tuesday 11th July, 2006
|
|
|
|
|
Hi,
I want to put a timer on each page to see how long it takes a page to load. Can someone please tell me what page event loads first, and what page event loads last? And how I would go about it?
Not looking for code samples, but just advice.
Regards,
Brendan
|
|
|
|
|
I think that PreInit fires first, and Disposed last.
The documentation says that Init and Disposed are the first and last stages of the lifecycle of a control, but the PreInit event was added in framework 2.0 as the Init even fires too late to be usable to set the theme of the page.
If you plan to show the time in the same page, though, the Dispose event is far too late. You have to do it somewhere around PreRender.
If you want to find out the real load time, and not just most of the execution part of the page creation, use Javascript to send along the time when the page was requested, and compare it to the time when the new page has loaded.
---
b { font-weight: normal; }
|
|
|
|
|
I can think of two ways to do this. I think you can subscribe to the BeginRequest and EndRequest events on the Global.asax. Also, I think you can grab the current context and get the Timestamp property. It's the timestamp of the initial request. Then you can add a handler for PreRender and write the page loading time into the page just before it gets sent back to the user. These are just ideas though, I'm not sure if that's the best way to do it.
Logifusion[^]
|
|
|
|
|
I’m about to create an options dialog that will be opened from my windows application main Forms menu.
I have many different “modules” in the application which each of them need to have an own options dialog. For sure this is a common situation.
I need some kind of “pattern” to create an Options dialog and add the other modules option dialogs in a tab-like way.
All tips of how I can do that in a clean way are welcomed!!
My next thing is to store all these settings (properties) in some kind of file and then restore the settings when my application runs next time. I’ve tried searched some articles but I really don’t know what to search on…
_____________________________
...and justice for all
APe
|
|
|
|
|
I have a very similar situation. I'll try to outline what I did:
1. Every module has a class implementing my IModule interface.
2. The IModule interface contains a method like OptionsControlBase[] GetOptionsControl() .
3. OptionsControlBase is simply an empty user control defining the following functions:
public abstract void ApplyChanges();
public abstract void UpdateOptions();
public abstract string Name { get; }
...
4. Now when the options dialog is opened it iterates through all modules, asks those for the options controls and generates one tab on the fly for each of them. The name of the tab is just what is returned by the Name property and the whole options control is docked with fill into the tab. Also one call to
UpdateOptions is done for each.
5. UpdateOptions implements the logic for filling the options control with the current application settings. Thus if you need some kind of reset button on the options form just call this one again on each control.
6. ApplyChanges gets called on every options control when the user clicks 'Ok' or 'Apply' on the options form. It contains the logic to apply the settings within the option controls to the application settings.
Everything clear?
To store and load these settings just add more functions (like GetSettings and SetSettings ) to your modules. Then when you want to load or save all application settings just iterate over the list of modules and call those functions on each of them.
|
|
|
|
|
hi,
I am new to c#, can any one help me how to get the position of the text from a text box and use them as a data.
for eg:
let input on the textbox be 10,20
i need to place that 10 to X and 20 to Y .
Thankyou,
Regards
Praveen
|
|
|
|
|
Use method Split.
for example :
this.textbox.Text = "10,20";
string[] mystring = this.textbox.Text.Split(',');
mystring[0] is 10
mystring[1] is 20
|
|
|
|
|
Hi! I would like to know if it´s possible to make a class object global.
Just like if I declared once, and a lot of classes can work with it, keeping the same values.
Because if I instantiate an object for every class... the values go blank =/ (Class obj = new Class())
Thnx
|
|
|
|
|
Hi,
make function and property as static so that you can call from anywhere without creating instance
-- modified at 6:39 Friday 7th July, 2006
|
|
|
|
|
Yeah something like:
public static decimal ComputeInterest()
{
// Code here
}
|
|
|
|
|
If you actually need an object instead of just static methods in a class, you can make a singleton:
public class Singleton {
private Singleton instance;
private Singleton() {}
public Singletton GetInstance() {
if (this.instance == null) {
this.instance = new Singleton();
}
return this.instance;
}
}
---
b { font-weight: normal; }>
|
|
|
|
|
private static Singleton instance;
public static Singletton GetInstance();
might though. Also, I read once, that private static Singleton instance = new Singleton(); would be gauranteed to be accessed in order and is not subject to threading issues. Whereas this.instance == null can cause threading problems.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: private static Singleton instance;
public static Singletton GetInstance();
might though.
Yes, correct.
Ennis Ray Lynch, Jr. wrote: Whereas this.instance == null can cause threading problems.
Yes, to make it thread safe you need locking.
---
b { font-weight: normal; }
|
|
|
|
|
How can i change programaticaly the position of the caret in a RichTextBoxControl ?
|
|
|
|