Answer Questions
jaime.rq overhead of passing arrays in memory vs. single elements to functions
Hello. I am trying to get a better feel for how memory management is done in the common language runtime. Specifically, if I have an array or other type of variable that contains lots of entries, I would like to know the pros and cons of passing that array or variable to a function versus passing a single element of the array to the function. In some instances, I find my code can be written in a cleaner and more readable fashion, as well as with fewer conditional statements and more standardized control flow if I pass a whole array to a function which only really needs one element of the array. If the array is already in memory, is there much overhead associated with passing the whole array to a function versus a single element Thanks a l ...Show All
Fille XML Serialization Over TCP Sockets
I have an appliction that serializes an object over a NetworkStream, and I want the receiving application to deserialize the object as effeciently as possible. Is it possible to directly deserialize an object using XML Serialization and NetworkStream's In VB, the receiving application has the following line of code: MessageObj = CType(Serializer.Deserialize(NetStream), Message) The application appears to hang on this line. However, when I close the application that originally serialized the object to the stream, the receiving application continues and successfully displays a value contained within the deserialized object. Is it possible for the object to be deserialized successfully in this manner Based ...Show All
KevinHall getRequestStream() throwing SocketException
Hello, I posted this in another forum but I believe it may have been the wrong forum to find the answer I am looking for. I am still very much a novice when it comes to .NET and programming in general so please excuse my naivete. I have a Windows Mobile 5.0 app written in Visual C# - .NET CF 2.0 I had a very simple login program that would query a MySQL database on a server and return some info about the user logging in. This code was working fine a couple weeks ago, and I got sidetracked to another project. Well, today I went to do some more work and I noticed that I could no longer login. My database was accessible and my login info was correctly entered. So I did some debugging and noticed that a line of code I had was throwing ...Show All
Jonathan Sampson ArrayList & DataSet...
If I have a Dataset with one table in it... I want to convert the columns of data in it to an arraylist How would i go about doing such could i just iterate through them...like foreach(ds.tables[0].rows[0]; in "dataset") { ArrayList.Add("datasetvalue") } can anyone point me in the right direction Could i just iterate through the row and then assign the row to the ColumnName thats right, just go through each column (of each row perhaps) to get all the values ArrayList theArrayList = new ArrayList(); foreach(DataRow curRow in ds.Tables[0].Rows) { foreach(DataColumn curColumn in ds.Tables[0].Columns) { theArrayList.Add(curRow[curColumn.ColumnName]) ...Show All
Troy Lundin Web Service changes my parameter type
Hi, I have a simple web service with a method having a custom type as a parameter. This type is declared in different namespace in other assembly. Something like that: public int Method1( Assembly1.Namespace1.Type1 parameter ) But in my client application the type of the parameter is changed. It regognizes it as declared in the web service namespace ( WebServiceNamespace.Type1 ) Is there any way to solve that problem. Thanks in Advance! Kostadin Thanks Peter, My problem is different. I don't want the wsdl to generates this new types because I can't cast them to the original types ( those in the Assembly i reference both in the service and the client ) and the scheme d ...Show All
chris441962 Just not understanding the transition from old AxMSWinsockLib to .Net
Ok, I'm just not getting it...I'm totally missing something. The 101 examples haven't helped me at all. I've got an app that was written in VB6. I used AxMSWinsockLib My current load looks like this: udpSocket.Bind(LocalPort) Then, I have an event driven sub: Private Sub udpSocket_DataArrival( ByVal eventSender As System.Object, ByVal eventArgs As AxMSWinsockLib.DMSWinsockControlEvents_DataArrivalEvent) Handles udpSocket.DataArrival Dim Stn As Short If eventArgs.bytesTotal = 1 Then Exit Sub End If Do While eventArgs.bytesTotal > 0 udpSocket.GetData(Packet) [...snip] Here's what I don't understand. How do I go from udpsocket.bind to .Net where ther ...Show All
HCTwinJava Ftp Upload File
This is my code snippet for file upload. The problem is after all the bytes are written on the server, while doing requestStream.Close() I get error as underlying connection was closed. FtpWebRequest request = (FtpWebRequest)WebRequest.Create(serverUri); request.UsePassive = false; request.Method = WebRequestMethods.Ftp.UploadFile; request.Credentials = new NetworkCredential("xyz", "xyz"); Stream requestStream = request.GetRequestStream(); const int bufferLength = 2048; byte[] buffer = new byte[bufferLength]; int count = 0; int readBytes = 0; FileStream stream = File.OpenRead(fileName); do { readBytes = ...Show All
Glynne WebMethod returning DataTable
I got an improper result in dot Net web service. For example, I have a WebMethod GetData, [ WebMethod ] public virtual DataTable GetData( string tableName) { DataTable retDataTable = obj.GetData(tableName); return retDataTable; } Whenever WebReference to client application, in client stub (Reference.cs) GetData webmethod return type taken as GetDataResponseGetDataResult instead of DataTable . This behavior only in case of DataTable, in other case it is okay. public GetDataResponseGetDataResult GetData( string tableName) { object [] results = this .Invoke( "GetData" , new object [] { tableName}); return (( GetDataRespons ...Show All
glassman324 System.Data.SqlClient
Hi All, Background: I am looking at writting a wrapper application that would capture querries connecting to SQL Server or any other database via ADO.NET for analysis prior to their execution and am wondering if there is a way to modify/replace the base class, put in place my wrapper to do its work and then call the original class library for the actual datbase connection. If this is possible, it will allow me to easily integrate my wrapper with any other compiled application using ADO.NET to access a database without updating references in the application source code and recompiling it; I really need to avoid the extreme amount of regression testing that this would require me to do. Question: Is it possible to make modificati ...Show All
Warren13 DecimalSeparator
Hi, I got 20 textboxes and i want to change the decimal separator to the one they have in their region settings. This is how i tried it: foreach (Control textbox in this.Controls) { if (textbox is TextBox) { int controlIndex = 0; for (int k = 0; k < 20; k++) { string decimalSeparator = System.Globalization.NumberFormatInfo.CurrentInfo.NumberDecimalSeparator; string input = this._textBox[k].Text; input = input.Replace(".", decimalSeparator); input = input.Replace(",", decimalSeparator); double d; if (double.TryParse(input, System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.CurrentCulture, out d)) ...Show All
dsani Service Pack for .NET Framework 2
Does any of the Microsoft guys know when approximately should we wait for the Service Pack 1 for the .NET Framework 2 I'm specifically interested to override this problem: http://support.microsoft.com/kb/917952 Thanks that is wierd, it should not do that. Can you also post any errors logged in the eventlog Service Pack for .NET Framework 2 Any news ... Beta, CTP and then final Dates Regards As far as things needing to be patched for .NET Framework 2... I have .NET 1.1 and .NET 2.0 installed on PCs running XP Pro, IIS v5.1. I get a dialog box with the following error message (I have noticed this on two different machines, both at home and work), right before shutdown (sc ...Show All
Derek Comingore problem using app.config codeBase element with private assemblies
I hope someone has some suggestions to my problem because I seem to have gone through all options. My problem is with an app.config codeBase and assemblyIdentity section. According to the latest MSDN docs, you can use the assemblyIdentity and codeBase elements to locate a PRIVATE assembly outside the root application directory. I have been able to make this work only by strongly naming the assembly and providing a fully-qualified href along with version on the codeBase element. I would like to do the following: <assemblyIdentity name="WCFServiceLibrary" /> <codeBase href=" file:///../WCFServiceLibrary.dll " /> The MSDN docs say I should be able to do the above. Only the name attribute of the ass ...Show All
Kitek_06 Network Logon Failed-Home network
I am testing a simple remoting solution and it works fine with all of the components on the same computer. However, when I test over 2 machines on my home network I am able to connect to the remote machine (and instantiate the remote object) with no problems, but when I attempt to call one of the remote object's methods I get a System.Security.Authentication.AuthenticationException exception: "A remote side security requirement was not fulfilled during authentication. Try increasing the ProtectionLevel and/or ImpersonationLevel." with an inner exception of: "The network logon failed" I am guessing that this is similar to connecting to SQL Server over a home network where you can't use Windows Authentication across ma ...Show All
kastanienreis XML Editor WinForm control?
I'm looking for an XML editor WinForm control to use in an application of my own (.NET 2.0 based). Is the Visual Studio 2005 XML Editor available for use to plug in to my application If not, can any one recommend one (especially one that performs validation of entered XML with a schema) Thank you - Chris That's nice but this tool is not publishable for commercial applications. John I am interested in one as well. Has anyone tried to use the XML Editor from the SharpDevelop IDE project Any luck finding something to work for you John I seem to be in a pretty similar situation. Turns out building a complete and u ...Show All
Romantic_touch WebBrowser Component. Navigating 50,000+ URLs
Hello, I have posted this in the "XML" forum too, however people suggested that it might be posted here as well: I have been using HTTrack combined with ASP.NET and SQL Server to archive web sites for Washington State. HTTrack fails to get all of the references from a web page, many of which can be found by using the DOM interface. With that said, I am working on a C# application that will crawl a list of URLs (about 55,000) and extract any references to web documents missed by HTTrack. My C# application uses the Web Browser class (have tried the axWebBrowser class as well) and the IHTMLDocument2 interface. If I use my application and crawl about 5,000 URLs it works like a champ. However, once I pass the 5,000 mark I r ...Show All
