Henry Wu's Q&A profile
Visual C# Converting date to system current date time format
Hello Can somebody help me for below problem In my .Net application I am using vb component having one method which accepts DateTime as a parameter. This value will be inserted into the database. The value to be passed to this method will be taken from some other database. Before passing this datetime variable I want to set the date format as a current culture system datetime format with ShortDatePattern. I used the below code to get the system short date format and to set that format to DateTime variable but the format is not getting changed to ShortDatePattern. Code :- string LstrSystemDateFormat = System.Globalization.DateTimeFormatInfo.CurrentInfo.ShortDatePattern; string LstrDateString = "15/01/2007"; DateTime Effec ...Show All
Smart Device Development Networking question: MTU check.
I have to know what is the network MTU on device. As far as I know there are two methods of checking MTU: 1) Check it by sending non fragmented datagrams, or 2) reading IPv4InterfaceProperties.Mtu Property. Both of them are not working on .NET CF. IPv4... is not supported as well as setting non fragmenting property in Socket class. Is there any other solution for this problem, that works on .NET CF This problem was connected with packet fragmentation problem. It was solved in: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=532111&SiteID=1 ...Show All
Visual Basic My.Settings strange problem
I have been trying to figure out why one of my settings will not properly save. Here is what the user.config file looks like: < xml version="1.0" encoding="utf-8" > <configuration> <userSettings> <Project_Tracker.My.MySettings> <setting name="MainLocation" serializeAs="String"> <value>86, 112</value> </setting> <setting name="Engineer" serializeAs="String"> <value /> </setting> </Project_Tracker.My.MySettings> </userSettings> </configuration> Notice that the setting for "Engineer" is not propery formatted. If I manually change the ...Show All
SQL Server Left outer join query?
Hello all, I am stuck in a bit of a mess, and i really don't know how to get out of it. I am a dot.net developer, working with MS SQL server 2000. I am trying to write a query which essentially gives the amount of stock available for a particular stock_code. select Stock_code, description from stock Now what i want to do is, for each one of the stock_code that apears in the table above i want to look into another table called pop_item, and get the closest delivery_date for that particular stock_code. So i have top 1 and order it by delivery_date desc. Individually for a particular stock_code, i can do this no problem. And here is my code for stock_code='E0016/6' select top 1 stock_code, delivery_date, order_number,qt ...Show All
SQL Server Msg 8621: The query processor ran out of stack space during query optimization
I got the above error when I tried to execute the following query delete from BUSINESS_ASSOCIATE where ba_name is null As you can see the query isn't exactly complicated. What the table does have is lots of dependancies. I got SSMS to show me all the dependancies and there are literally hundreds (maybe thousands - I'm not going to count them all) of dependant tables and i suspect that is what is causing the problem. So what do I do about it This is a valid data-model (industry standard in fact) but SQL won't let me delete data from this table and that's a huge problem for me. Any advice about how to progress would be welcomed. -Jamie It looks like you hit the documented limit on the maxi ...Show All
Visual Studio 2008 (Pre-release) DataContext = this ?
In code I can do this: this.DataContext = this; (I use it for binding to local clr-properties) How can I do that in xaml Best regards, Thomas Andersen you can give a x:Name to the root(Window) and use that in the binding DataContext = " {Binding ElementName=window1} " ...Show All
Windows Forms PrintPreviewDialog problems
Hi! I've my own PrintPreviewDialog and a lot of objects WebBrowser to print. I want to show only the print preview to the first one and set the print properties and apply them to the others, and that's why I created my own PrintPreviewDialog. Now, I've just one problem... How do I set an HtmlDocument (from my first object WebBrowser) to the preview I made something like PrintDocument pp = new PrintDocument(); pp.DocumentName = this.primeiroFicheiro; this.Document = pp; where "this" is my PrintPreviewDialog and "primeiroFicheiro" a string that contains the path to my html document (that I want to preview...). I made like this and I thought that this way everything would works fine, but when my PrintPreviewDialog is show ...Show All
Visual Studio Team System Changing target assemblies on .FxCop project files from Visual Studio 2003.
Hello, I have FxCop 1.35 and VS 2003, where FxCopCmd.exe is added in External tools. I'm wondering if there is some way to use FxCopCmd with my own custom filter on rules (maybe to exclude some of Naming Rules but not all section). Curently i'm passing command parameters with target assembly and directory where rules assemblies are located. Maybe using .FxCop project file passed like command line parameter is answer to this question Can Visual Studio 2003 add/remove target assemblies on pointed .FxCop file Thanks Aleksandar The easiest way would be to pass an FxCop project using the /project switch. For instructions on doing this, see the following post: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=244375&Si ...Show All
Visual Studio Team System The virtual server that is referenced here is not in the config database
I am sure almost everyone reading this forum has run into this problem before. What I am not sure about is how to fix it, except by doing a complete TFS/SharePoint reinstall (which is not acceptible). Here's how to reproduce this problem: I'm successfully using TFS and creating team projects. Everything works fine. I then stop the TFS/Report Server/SharePoint Web site in IIS. This is the Web site all my SharePoint sites run from (e.g. http://tfs/sites/MyTeamProject ). I start the Web site again. After this point I can no longer create new team projects. Any attempt results in this error: "The virtual server that is referenced here is not in the config database" Strangely enough, sometimes after that I am able ...Show All
Windows Live Developer Forums MSN MESSENGER
I am using Visual Basic 2005. I would like to make an application which can control some options of MSN Messenger like sending an instant message. I would like to know which dlls I need (if any) and any references (if any). I would like someone to show me hiw it must be done. Thanks You can use dotMSN if you use .NET. I think it seem not be a native VB SDK you can send instant message. I can convert my VCL component to VB SDK if you like. ...Show All
Windows Forms DataGridView AutoFilter whitepaper and sample
Are you spoiled by the AutoFilter feature in Excel Do you want the same functionality in the DataGridView control Then my new whitepaper and sample are for you. See: http://msdn.microsoft.com/netframework/windowsforms/default.aspx pull=/library/en-us/dnwinforms/html/DtGrdVwAF.asp The DataGridViewAutoFilter library provides a custom DataGridViewColumnHeaderCell with a drop-down filter list that displays each unique value in a column, and updates the filter of the bound data source when a value is selected from the list. A custom DataGridViewColumn is also provided to make using the AutoFilter header cell easier, particularly in the Windows Forms Designer. Customizing DataGridView column header cells is not as easy as customizi ...Show All
Visual Studio Express Editions Comparing Values in an Array to another Variable | MonthType
Hello! I am writing a program for an office accounting application which (so far) takes a user-selected date and analyzes it to determine the LeapYear = true or false and MonthType (number of days in month: (1)=30 days, (2)=31 days, (3)=28 days , (4) = 29 days) I am doing this in order to determine how many days the last pay period of the month will have in order to properly format a form for input for that particular month. This is the part where I am stuck., I did this: Dim LongMonth As Integer () = {1, 3, 5, 7, 8, 10, 12} Dim ShortMonth As Integer () = {4, 6, 9, 11} ... Dim x As Integer Dim monthtype As Integer Select Case PickedMonth Case Is = 2 If Pic ...Show All
Visual C# Object reference confusion.
I have a simple function located in Class2.cs - an auxiliary file for Form1.cs (Console Application in VS2005). It take one parameter: string. This string is supposed to serve as a switch for selecting the right string to build. public string getConnStrings ( ref string switched ) In the calling function I call the function in question as: string switched = "1"; string str1 = Class2.getConnStrings (switched); // or (ref switched); I get this error: Error 1 An object reference is required for the nonstatic field, method, or property 'tapTCPports_1.Class2.getConnStrings(ref string)' D:\VCsharp_Projects\tapTCPports_1\Form1.cs 1231 21 tapTCPports_1 When I placed the function getConnStrings into the ...Show All
Smart Device Development Online-Event
Hello, i need to know, if my device is connected via gprs, active sync or whatever. Always when the device gets disconnected, the system changes the icon for the "online-status" in the titlebar. Is it possible to use this event in my application too Or do you know another event-notification which fires an event, when the device gets connected or disconnected Is it also possible with OpenNetCF Thanks The MSDN documentation should provide enough info to figure out which property to use. I'd try the SystemState.ConnectionsCount property. ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Power of XBOX360 - raw triangle power
Hi, I was wondering if it was possible to compare the graphics power of XBOX360 to any of current gfx cards. Say, if it`s capable of rendering same amount of triangles as e.g. GF6800 does. The old XBOX was usually compared to GF3 in terms of graphics performance. The reason I ask is, that I would like to know the general boundaries of the raw gfx power, since I`m planning on converting some of my current games to XNA (and later to XBOX360) as soon as it becomes available. Currently I`m pushing the GF6800 card to its limits, which means I`m rendering a range of 0.5M-1.0M triangles (all unique, non-instanced) per frame and it seems that GF6800 starts to slow down when it crosses 1M barrier. No pixel shaders there, just Vertex Shader ...Show All
