doug finke's Q&A profile
SQL Server Get number of business days between dates
Hi. Is there a way to get the number of business days or hours between two dates Also, is there a way to have it ignore weekends and U.S. holidays Thank you. i am using this script to get amount of business days Code Snippet set datefirst 1 declare @sdate datetime declare @edate datetime select @sdate = '20070516' --for example, start date May, 16th select @edate='20070531' --end date May, 31st select datediff(day, @sdate, @edate)+1-( select (case datepart(dw, @sdate) when 7 then (datepart(ww, @edate)-datepart(ww, @sdate))*2-1 else (datepart(ww, @edate)-datepart(ww, @sdate))*2 end)+ (case datepart(dw, @edate) when 6 then 1 when 7 then 2 else 0 end) ) ...Show All
Software Development for Windows Vista Vista Final Release Date
Have to plan IT budget for hardware & software. Can anyone tell me what is the deadline of the Vista Project if there is one From MSDN Subscriber downloads: Office 2007 is now available from MSDN Subscriber Downloads. Windows Vista is expected to be available on Friday November 17, 2006 PST Good News for us Developers ! ...Show All
Visual Studio Express Editions How a subroution can receive "addressof <<sub>>" as a parameter?
I want to build a menu from list of lines like: TopMenu1.SubMenu1.Item111 TopMenu1.SubMenu1.Item112 TopMenu1.SubMenu2.Item121 TopMenu1.SubMenu2.Item122 TopMenu1.SubMenu3.Item131 TopMenu1.SubMenu3.Item132 I have coded a menu builder which return a "ToolStripMenu" from above list of lines. However, the ToolStripMenuItem Item111, Item112, ..., needs a click handler. It is better for my menu builder subroutine to accept "addressof <<sub>>" as parameter so that during the build, I can add the handler to each of the menu item. I fail to do so. Now, I can only scan these Items to add the handler after the build. It's a bit murky what you are trying to do. I'm guessing that your creating a menu from ...Show All
Windows Forms ListBox control changes selection on MouseDown, not MouseClick - can this be changed?
Hi all, I have a class that inherits from ListBox and provides drag/drop functionality. I'm finding that selecting multiple items to drag is frustrating, because ListBox doesn't handle a "multi-select-followed-by-drag" operation in quite the same way as ListView (or, eg. Windows Explorer) Try this: Open your "My Documents" folder, select a file. Hold down Ctrl and click a few more to add them to the selection. Now - if you mouse-down (ie. click but don't release) the left button on one of the selected items, it'll allow you to pick them up and drag them. The item selection doesn't change until you release the mouse button. The WinForms ListView control also behaves this way, but the ListBox control appears to u ...Show All
Visual Studio Express Editions user backup - what is wrong with this script??
with this script the backup is not working correctly, can someone find where is the problem We have 15 computers in our network and with this script it is not going correctly. If someone can find the problem I’ll be grateful. This is the script: on error resume next countup = 0 Const READFILE = 1 ' text file constants const HTML = 0 const NORMAL = 1 Dim fso, f, ts, shell, foldersfound, foldersNOTfound, errormsg, foldersmade, oldFolders dim author, recipient, subject, body, i, temp, fo Set fso = CreateObject( "Scripting.FileSystemObject" ) ...Show All
.NET Development Cannot update form
GoodDay I have put a database onto a form designed in vb 2005 express. When I work on the form it sometimes cannot update with new data and leaves a message JIT debugging problem . How can I set the JIT debugging so that I can work on my data and update the form live. Thanks in advance Rob I don't see how the KB article you've pointed to has anything to do with the behavior you're describing. Just because it has the term JIT compiler error doesn't mean they are related. As mentioned, this belongs in the VS forms since the error is happening in VS. You'll also need to provide way more information about the specific error and what is happening in the program when the error occurs. I'll get you started by moving this thre ...Show All
SQL Server Problem in RSWebApplication.config file
Hi i used http://msdn2.microsoft.com/en-gb/library/ms160724.aspx MSDN Article sample to enable custom security method in to my report project, also i RSWebApplication.config <ReportServerUrl>http://localhost/reports/pages/folder.aspx</ReportServerUrl> but each time when i login using a correct user name and password from the login page it just automatically redirect to the http://localhost/reportserver url but i need to change it to the http://localhost/reports/pages/folder.aspx url how can i do this task regards sujith Hi Sujith, You misinterpreted the instructions. The ReportServerUrl must point to the report server virtual root, not the report manager vir ...Show All
.NET Development FTP directory browsing and file download
Hi, I am having a problem when I log in to the ftp server to download a file. FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://nndata.se/user/test.txt"); request.Method = WebRequestMethods.Ftp.DownloadFile; request.Credentials = new NetworkCredential("user", "pw"); FtpWebResponse response = (FtpWebResponse)request.GetResponse(); I want to download the test file from that specific directory above. However when I use this code in some way the ftp server adds the "user" string to the directory and starts looking for the test.txt file in this directory: nndata.se/user/user/test.txt I get a a file not found exception back. Anyone knows how to solve this, without changing the ...Show All
.NET Development XSD v2.0 vs. XSDObjectGen
Does anyone have any thoughts around the pros/cons of using XSD v2.0 vs XSDObjectGen XsdObjectGen solves several xsd.exe usability problems like Generating fields (not properties) Generating arrays instead of collections or lists Producing a single source file The main differences are outlined in the xsd object code generator readme: http://apps.gotdotnet.com/xmltools/xsdobjgen/readme.htm However, you also should consider that the xsdodegenerator is not a supported tool. Thanks, Elena Kharitidi ...Show All
Visual C++ How to make CDialog-based dialog in non-MFC project?
Hi I've downloaded a non-MFC project and added MFC support to it. It has compiled fine and I was able to use CString, AfxMessageBox. The next step I took was adding a CDialog class to this project. I used the Class Wizard and tried to create a CDialog-based dialog class, but the Wizard told me I can't create this class in non-MFC project. I guess this is because I've just added MFC support, not actually creating one. So I managed to write down a CDialog class myself, and I copy & pasted CDialog code from another MFC project. It gave me whole bunch of errors. The errors were about dialog resource id, OnInitDialog, m_hIcon, SetIcon, each informing me it wasn't declared, called a non-static member function, cann ...Show All
Windows Forms including external folders in ur deployment package???
hey... Can anyone tell me if it is possible to include folders and files within them in the deployment package I am trying to include 2 folders with files in these folder with the deployment package, so that when my program is installed on a system the two folders are placed in the same folder as the application path. I know that it is possible to add files, but I can't seem to find a way to include these folders. i am using VS2005 thanks in advance Sorry but it seems i wasnot very clear in describing my problem the folder content is different each time you run the setup program the folder reside beside the setup program (setup.exe) so i need to include the folder names not the files inside this folders i hope i ...Show All
Windows Live Developer Forums i need some help on nick changing
the problem is i can't change my display name in windows live messenger, and my current display name is my email address, it just remains the same display name no matter how i change it. just recently, i tried to log in my account using windows messenger. i change my display name there and it did work. however, when i back to windows live messenger, i encounter the same old problem again. by the way i can neither change the personal message in windows live messenger. anyone know why on earth does this happen I understand that this is the wrong forum but I want to say that somehow my problem was fixed. I don't know if Microsoft did it as they said they couldn't help me anymore and I have had no email from ...Show All
Visual Studio Express Editions Building Threads
Hi I have an application written in VB.Net that queries a SQL Server database on search queries, but depending on times and network traffic retrieval times can be quite lengthy. Can I build a Thread in .Net where it can execute the search query and I can can continue executing code in my application, alert the user that the application is retrieving the data and show a timer of some sort. Is this possible THank You Thanks littleguru fo the quick response.... any samples as to the structure of the class and the required methods...I've never worked with THreads before and this is an urgent requirement Cheers ...Show All
Windows Forms Panel and images
what is the code to change the background image of a panel control thanks Is this what your looking for public partial class Form1 : Form { private Bitmap newImage = new Bitmap(500,500); public Form1() { InitializeComponent(); Graphics g = Graphics.FromImage(newImage); g.DrawLine(new Pen(Color.Black), 0, 0, newImage.Width, newImage.Height); } private void button1_Click(object sender, EventArgs e) { this.BackgroundImage = newImage; this.Refresh(); } } B14 ...Show All
Smart Device Development using Microsoft.WindowsMobile.PocketOutlook;
In my codes, I type that using Microsoft.WindowsMobile.PocketOutlook at my codes head. But it can not pass building. the error tell that there are no WindowsMobile at namespace Microsoft. why Thank you You need to add the assembly as a reference in the projects where you are using this namespace. You can do this by right clicking on the References folder in the solution panel and selecting add reference, Microsoft.WindowsMobile.PocketOutlook will show up in the list. ...Show All
