I would think so, although i havent really looked at it explicitly. Generally there will still be a similar overhead as with delegates which is genrally 8 - 10 times slower than a normal non-virtual call. For maximum speed I recommend using an interface.
When I try to use a web service on a computer that connects to the Internet through a router, I get this exception:
System.Net.WebException: The operation has timed-out.
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object parameters)
at WebTest.com.dacris.www.DBAccess.Select(String query)
at WebTest.Form1.button1_Click(Object sender, EventArgs e)
Does anyone know why this might occur and how I could fix it?
Well, my first guess would be that the web service method is timing out! Also, everything connects to the Internet through a router. Is this web service behind a proxy, or is your client behind a proxy? In some cases, SOAP messages will not work through proxies if not configured right (the client request, that is).
I see you're using a database from the calls you're making. It's possible that the query is accessing large amounts of data and is taking longer than the response timeout. In making the request (using the HttpWebRequest), you can increase the timeout by setting the Timeout property to something higher than the default (which is, oddly enough, 100 seconds).
Heath Stewart wrote: Well, my first guess would be that the web service method is timing out!
Well, I've tried calling other web services and methods. Some methods have nothing to do with data access. I've even tried Google's APIs.
Heath Stewart wrote: Is this web service behind a proxy, or is your client behind a proxy?
The client is where the problem occurs, but the client is not behind a proxy.
The server doesn't matter. As I said, I tried Google's web service, and it too does not work. The error message is the same.
Heath Stewart wrote: In some cases, SOAP messages will not work through proxies if not configured right (the client request, that is).
How might they be configured incorrectly?
Heath Stewart wrote: you can increase the timeout by setting the Timeout property to something higher than the default (which is, oddly enough, 100 seconds).
I've tried this to no avail. I tried a timeout of 300 seconds and it still generated the same error message.
That is to be set only if you're using a proxy, otherwise don't mess with it. You said you're not using a proxy, so other than checking the domain restrictions on the computers in your test lab, I really don't know what to tell you.
Have you tried running the app as a privileged user in the test lab, like some domain admin or the local computer admin? Even with such elevated permissions, the local or domain security policy might be disallowing certain things that are necessary.
ComponentDesigner.OnSetComponentDefaults() executes only when the component is dropped on a windows form. In case of a web form it does not execute. Although the designer object is constructed in both cases. This looks like a framework/IDE bug to me.
DataGrid customization...... I am building a DataGrid for
displaying some values in a DataSet. I am able to:
- resize last visible column to fill the entire client area of the DataGrid
- Hide and redisplay columns by using ContextMenu
- Filter the DataGrid with use of a filter expression
The next thing on my list, is wrapping text in DataGridTextBoxColumns.
I am able to resize all the cells by overriding some methods
of a DataGridTextBoxColumn(GetMinimumHeight, GetPreferredHeight), but
this makes all the rows the same height.
I want to wrap text and resize the cell to fit per individual row.
Is there anybody out there that knows how to do this?
(or maybe Microsoft would like to replace it's DataGrid with one that
does not suck.)
Does anyone know how to tell if an icon oject has been given a value.
Even if I set the object to null as shown below, the object is still set to undefined. So if I use the following code I get an error:
There's no easy way with System.Windows.Forms.ToolBar. You could try overriding WndProc and drawing a background image for WM_ERASEBKGRND, but you'd probably just be better off getting a better toolbar. Search the CodeProject web site. There are a lot of examples. You can also find many commercial products, but just understand that the ToolBar class in the .NET BCL is pretty basic and changing it would require about as much (if not more) than just writing one from scratch.
Use WebRequest.GetRequestStream. You must set the Content-Type of the WebRequest before getting the stream to either "application/x-www-form-urlencoded" (and post the "key1=value1&key2=value2..." encoding like in GET requests) or "alternative/form-data" if you plan on posting files in MIME message. To just post a username and password, use the first option.
To see a good example, see the .NET SDK documentation for the WebRequest.GetRequestStream method.