Micael Baerens's Q&A profile
.NET Development SslStream.Read() - Returns invalid data
Hey, I am currently attempting to implement a multi-threaded C# socket, using SSL (.pem file/certification/private key combo) server using Visual Studio C# Express. I have successfully made the client application establish a connection, and send data, which appears in plain, de-crypted text on the server - this works. However, I am 'polling' the socket to see if data is available to read. Here is some code which is appropriate: ---- public void Process(int threadId) { int BytesRead = 0; try { Master.Log("BEGIN READ"); sslStream.ReadTimeout = 5000; BytesRead = sslStream.Read(bytes, 0, bytes.Length); Master.Log("READ " + BytesRead + " bytes"); if ( BytesRea ...Show All
Visual Studio Cannot change the reports of ReportViewer control
I am using a tree to select various reports to be displayed into the ReportViewer control on a winform app. However, only the first report is displayed and the control does not reload any other reports. Using the following code does not change the report being displayed: this .reportViewer1.LocalReport.ReportPath = "selected report path" ; this .reportViewer1.RefreshReport(); Is this a limitation of the control Is the only solution to re-create a ReportViewer control for each report to be displayed Thanks. Gidaye Beats me...I have the same problem. One Viewer and 2 different Reports, Two buttons on the form, One for each Report. If i use "viewer.reset", it tells me t ...Show All
Visual C++ default destructor and list iterator
I came across a problem with a default destructor. The problem has been distilled down in the code at the end. I have an Iterator class that is used to access std::list<>'s. The original design was that a pure abstract base class was used to provide an interface. But if I define a pure abstract base class, bad things happen. From what I can see, the default destructor does the wrong thing and delete's the pointer to the std::list<> used by the subclass. Here is where it gets truely odd: only if the std::list<>::iterator in the object is initialized, does the destructor do something bad. Simply creating and deleting the object does not create a problem. If I implement destructors that do nothing, all is well. But my dest ...Show All
Visual Studio Visual Basic Debugger Crash
I have just recently installed Visual Studio 2005 and in my GUI Design class we have opted to use Visual Basic. The problem I am having is that whenever I try to use the debugger by setting a breakpoint, everything goes well until I actually reach the breakpoint. When my program reaches the breakpoint, everything freezes up. I am unable to force quit the program or Visual Studio, or alt-tab to any other applications. The only thing I am ever able to do is bring up the task manager with ctrl-alt-del, but I am unable to kill processes or anything from the window, as it too freezes when I click on the window with the mouse. This is on a fresh install of Visual Studio 2005 on a fresh install of Windows XP Professional SP2. I have all the updat ...Show All
Visual Studio 2008 (Pre-release) WCF services from existing wsdl
I want to generate a wcf service from an exiting (non .NET generated) wsdl file. I created the service code using the .Net 3.0 SDK svcutil and discovered that the wcf service wsdl is completely different from the original wsdl used to generate the .net service types. How do you ensure that the .Net service metadata mirrors the original wsdl as I have .Net clients generating their proxies from that original wsdl and compatibility becomes an issue. The .Net wsdl is creating new wsdl messages and parts it just doesn't jive with the original wsdl. Some insight into how to work with 3rd party wsdls to build a .Net service is appreciated. Chris Thanks for the suggestions. I went back and ran the svccu ...Show All
Visual Studio 2008 (Pre-release) Error in svcutil
Hi all, I successfully created a simple service hosted in the managed application (console application) or can be called a self-hosted service. Now w hen i create the proxy for service using svcutil its says " Error: An unexpected error has occurred in the tool. Error: Method not found: 'System.Collections.Generic.Dictionary`2<System.String, System.ServiceModel.Channels.Binding> System.ServiceModel.Configuration.Metadata Element.LoadMetadataExchangeBindings()'. " And SDK is not installing in my machine. it shows "Debugger error" while installing. So, i just copied the files under Microsoft SDKs in c:\program files and pasted in my system's c:\program files. I came to know that there is programm ...Show All
Windows Forms datarelation and dataview
Simple q regarding .net 2003 I got several tables A master and e few details/child tables add datarelations to it and bind it to controls... so far so good Now i wan't to filter/search the mastertable, Sound easy but when i use a dataview i lose sync with the detail/child tables Remco for those still diddn't find a solution......... It's so simple it's stupid Assume we have a dataview called dvdataview masterGrid.DataSource = dvdataview masterGrid.DataMember = "Customers" detailGrid.DataSource = dvdataview ' this is the row what makes the difference detailGrid.DataMember = "CustomersToOrder" Simple binding Me .t ...Show All
Windows Forms Adding data to child tables using FormView and Object DataSource
I have a FormView that displays all data in its item template view and another formview that displays related data. I am filtering the child data using the SelectedValue of the Parent FormView. The problem is when I want to add records; Adding data to the parent work just fine. but when I want to add records to the child table I don’t want the user to enter the id of the parent record, since the parent data is already displayed above it is understood that the user add child records to that parent record.. Unlike the read-only view I am not able to get the SelectedValue of the parent View. Is there any means to get the parent id... If the above problem is not clear, let me take an example: I am displaying details of an event ...Show All
Visual Studio Can't Find Crystal Reports
Hello, we have Visual Studio Team Edition installed on a machine. We're trying to use Crystal reports, but we can't find it. I checked the installation, and it claims to be installed. It doesn't appear in the new file list anywhere. Thank you for your help! Hm. Visual Studio Team System appears to be a collection of about seven different versions of Visual Studio (See the products page for more details ). There's a chance that you have a version of Visual Studio that does not include Crystal Reports for Visual Studio, such as Visual Studio Team Foundation . If you select Help >> About Microsoft Visual Studio, what products are listed in the 'Installed Products' list - Dave ...Show All
Visual Studio 2008 (Pre-release) proper way to use BuildWindowCore params?
In the following code, I'm attempting to make my own .NET 2.0 form act as a FrameworkElement. I'm having trouble in the BuildWindowCore function. As I understand it, I'm supposed to take my existing form and make it a child of the input HWND. I don't know how to take the hwndParent.Handle and turn that into a System.Windows.Forms. Control. I've stepped through the code a number of times trying different things includeing WINAPI SetParent all with no luck. It's too bad Wrapper is null. That would at least give me an idea as to what type of object it is. public class AppWindow : HwndHost { private AppForm _appForm; // AppForm inherits from System.Windows.Forms.Form public AppWindow( AppForm appForm) ...Show All
Windows Forms PrintPageEventArgs Supplies a Graphics Object with Random VisibleClipBounds
I am facing a problem where only a portion of the page I am trying to print shows up on the printer. I see that the same problem is reported by a number of people: a. http://www.thescripts.com/forum/thread225516.html b. http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=38324&SiteID=1 c. http://www.dotnet247.com/247reference/msgs/24/121201.aspx After spending some time, I find that the Graphics object supplied by PrintPageEventArgs in the PrintPage event is giving a "random" VisibleClipBounds. For the same printer, sometimes it is big enough for the page, sometimes it is not. In one debug session, I printed my application to different printers one after another by selecting them from a standard PrinterDialog I ...Show All
.NET Development The type or namespace name 'PasswordDeriveBytes' could not be found ???
i'm a newbie. i'm building a project when the following errors occured. The type or namespace name 'PasswordDeriveBytes' could not be found (are you missing a using directive or an assembly reference ) i'm doing some encryption and decryption using the code below: secure.cs using System; using System.Collections.Generic; using System.Text; using System.IO; using System.Security.Cryptography; namespace TEST { public class Secure { public string Encrypt(string plainText, string passPhrase, string saltValue, string hashAlgorithm, int passwordIterations, string initVector, int keySize) { byte[] initVectorBytes = Encodi ...Show All
SQL Server How to select 'save results as' file extension
I create ad-hoc queries, eventually with 'results to text'. Then I 'save results as'. With SQL 2005 Management Studio, the file extension is .rpt. For several reasons, I need to specify the default file extension to be .txt. In my old school (Query Analyzer), we had an option for 'Result File Extension'. I need this. Select "All Files *.*" and type in the whole name as you want to save the reults like Something.txt HTH, Jens Suessmeyer. --- http://www.sqlserver2005.de --- ...Show All
Visual Studio 2008 (Pre-release) Why does basicHttpBinding have SOAP12 and WS-Addressing in my wsdl?
Hello, I just changed the config on WCF Technology samples-> Basic -> Service -> Hosting -> SelfHost The original config file had wshttpbinding but I changed it to basicHttpbinding file and checked out the wsdl and I got the following. < xml version="1.0" encoding="utf-8" > - < wsdl:definitions name =" CalculatorService " targetNamespace =" http://tempuri.org/ " xmlns:wsdl =" http://schemas.xmlsoap.org/wsdl/ " xmlns:soap =" http://schemas.xmlsoap.org/wsdl/soap/ " xmlns:wsu =" http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd " xmlns:soapenc =" http://schemas.xml ...Show All
SQL Server Select not exists very slow
SQL 2005 on CoreDuo 2.8 ghz, 1 GB ram, Windows XP I have the following tables: inLogData with about 1 million rows. Three of the 22 columns are: FromIP varchar(255) null DateCol varchar(255) null TimeCol varchar(255) null. Weblog with about 200,000. Three of the 24 columns are: FromIP Varchar(50), DateChar varchar(24), TimeChar varchar(12) weblog has the following index: CREATE NONCLUSTERED INDEX [WebLog_DateHourFromIP] ON [dbo].[Weblog] ( [DateChar] ASC, [TimeChar] ASC, [FromIP] ASC )WITH (SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF) ON [PRIMARY] I am running the following SQL script: Select top 200 FromIP, DateCol, TimeCol From inLogData l where not exists (Se ...Show All
