CaptainSmudge's Q&A profile
SQL Server sum of distinct values
Hi all, I need a sum on distinct values. I have various duplicate details lines and just need to sum the unique values. The distinct values have been calculated on one group footer (employees), and now I want to sum the distinct values into the below group footer (Team Leader). Can anyone assist me with this. Regards, Alana I know exactly what you are trying to accomplish. I worte a function based on the link below in Code and used it. This works fine. http://blogs.msdn.com/bwelcker/archive/2005/05/10/416306.aspx But the only disadvantage with this is you have to create similar function if you have to do a sum for another distinct field. I hope this helps.. Thanks, ...Show All
Visual Studio Team System Regular Project Type Templates
I had a working installation of VSTS with TFS beta 3 refresh. In between, I did not work for 3 months and everything broke. After that, I could get TFS for workgroup going. Before TFS for work group, TFS client was already installed. But after installing TFS for WG, when I try to create a new project, I do not see all the regular project type templates. All I see is "Business Intelligence Projects" and "Other Project Types" under which I see "Blank Solution" and "Search Online Templates". What do I have to fix to see all the regular project types including "Distributed Systems Solutions". You need to install one of the Team System sku's or (if you have i ...Show All
Visual C# Replacing '\r' in a string: .NET 1.1
Hi All, I have an application that takes input and splits it on the '\n' character. Every carriage return however is a combination of '\r\n', therefore I am left with stray '\r' characters. I wish to remove these characters with the minimum of fuss in the .Net framework 1.1! I have already formulated a way to do this using stringbuilder.replace, however is there an easer (and more efficient) way as I will be applying this to millions of strings. Thanks Chris why dont you just replace \r with String.Empty Example... string myString = "hi\r\n my name is bob"; myString = myString.Replace("\r", String.Empty); string[] arraySplitString = myString.Split(new string[] {"\n"}, StringSpli ...Show All
Visual Studio Express Editions Getting numerical input from a masked textbox using VS2005 Visual C++
I am trying to use a function to divide 2 numbers entered into masked textboxs. I have masked the text boxes for 10 numbers. The masked textbox names are maskedTextBox1 and maskedTextBox2. Here is my code: void seti( void ) { if (maskedTextBox1->Text->Equals( "" )||maskedTextBox2->Text->Equals( "" )) { //didn't enter everything MessageBox::Show( "You must enter both numbers to proceed." , "!!!Error!!!" , MessageBoxButtons::OK, MessageBoxIcon::Stop); } else { ckt.i = ((System::Windows::Forms::MaskedTextBox ^(maskedTextBox1->Text))/(System::Windows::Forms::MaskedTextBox ^(maskedTextBox2->Text))); lblI->Text = ...Show All
Smart Device Development DeleteSubKeyTree() throws ArgumentException. Help!
Hi, I'm posting my code here. Microsoft.Win32.RegistryKey baseKey = Registry.Users; //RegistryKey accountsKey = baseKey.CreateSubKey("Accounts"); RegistryKey accountsKey = baseKey.OpenSubKey("Accounts", true); if (accountsKey != null) accountsKey.DeleteSubKeyTree("Accounts"); // throws ArgumentException accountsKey = baseKey.CreateSubKey("Accounts"); for (int i = 0; i < _accountsList.Count; i++) { Account account = (Account)_accountsList ; if (account.userID != "") { RegistryKey accKey = accountsKey.CreateSubKey(IMType.getServerName(account._imType) ...Show All
Smart Device Development launching external application on device from c#
Hello, Hopefully someone can help me... I have two c# apps, App1.exe and App2.exe. They are both in the same directory on the device, What i am trying to do is either... Have App1 to call App2 directly, Have App1 run a file that is associated with App2 (which would automatically open up App2) or Have App1 call App2 directly and pass a file name to it to open. I have tried... CreateProcess(txtApp.Text, txtParam.Text); and a few others that i have found but they all return errors and wont compile. and i have looked at the Process class from OpenNETCF but i have so far had no success. Does anyone have any example code they can share or know of any useful links to help me on my way... (preferrably without having to use the fi ...Show All
.NET Development Which class I should use in communication?
Hello, I am a new user of this forum. I need some advice. In System.Net.Sockets namespace there are two class, NetworkStream and Socket Classes and in System.IO there is Stream class for using TCP/IP connection between server and clients. I have read their members, properties and events in MSDN, they are nearly the same but I wonder there are any advantages or disadvantages between them. For my program which class should I use I use TCP/IP and DNP (Distributed Network Protocol) for my application, some devices connected to LAN sends data to my application also my application can send commands to these devices. But I can not decide which class do I use. Hello Mertkan, Rizwan# again :P lol. I'm curious @ no body is pointing out the ...Show All
Windows Forms Changes in database and update datagridview problem
hi, i have a WinForm datagridview (dgvUser) that is populated with data from a SQLEXPRESS db. On the same form I collect user input using textboxes and after user clicked on OK button, those information will be saved to the database. At this point, everything is perfect. At the same time, I want the dgvUser to update itself with the new info. I have read others' posts regarding this issue and tried some suggestions from posters. From what i see, the datagridview was refreshed but the data wasn't updated. Anyone with solutions or suggestion please help. Million thanks. Regards, Sha To updata database, try following 2 ways, hope it works for you. this .Validate(); this .customersBindingSource.EndEdit(); ...Show All
Visual Studio Team System Structure
Over the last few weeks I've been reading up and playing with TFS getting ready for shifting our development team off VSS and on to TFS. I've battled with getting TFS installed, figured out which process template to go for, given the Project 2007 integration a poke and all that jazz and I'm very impressed. The last decision I'm left with now is the structure for the code. I've got structure for handling Branching, I went for: Project -Branches -Releases -Trunk but what’s bothering me is that whilst were currently working on our main product (which will be made up of 4 applications) in the future we will have more products which will share some core code. In addition to this we also have the utility applications we have made. ...Show All
SQL Server Error rsAccessDenied
When I try to deploy one of my Reports I receive the following error : Deploying to http://localhost/ReportServer Error rsAccessDenied : The permissions granted to user 'BOGDAN\IUSR_BOGDAN' are insufficient for performing this operation. That is because I configured IIS for those 2 folders ReportServer and Reports to accept anonymous . If I turn anonymous off and let windows authentification on he lets me to deploy the project , but I can see anymore http://localhost/Reports and http://localhost/ReportServer because he asks for password and I don't have any password set for the computer , nor for SQL Server . I just use Windows Authentification for all. I searched through this forum but nothing is significant ...Show All
Game Technologies: DirectX, XNA, XACT, etc. InvalidCallException in 3D primitives code attempt
Hello, Lacking full examples in the docs, I threw together some of the sample code in the How to: Draw 3D Primitives section, probably incorrectly, and am getting an InvalidCallException on the following line: graphics.GraphicsDevice.DrawUserPrimitives<VertexPositionColor>(PrimitiveType.TriangleList, 12, nonIndexedCube); The details of the exception are not helpful. They say "External component has thrown an exception." My code is below, hopefully this forum formats it ok, without smiley faces etc. Any suggestions appreciated. By the way, I am using an ATI Radeon Mobility X600 and had no problems compiling and running the Spacewar demo. - Matteus using System; using System.Collections.Generic; using Microsoft.Xna.Framework ...Show All
Visual C# String to bool Conversion
Hi, I am a beginner of C#, let alone programmin in general. I was practicing some for loops and if statements. So I came up with the following code: using System; namespace ConsoleApplication1 { class For { public static void Main() { int sum; int i; Console .WriteLine( "Hello and welcome to the randomonitator" ); Console .WriteLine( "You have two choices, (1) or (2)" ); Console .Write( "Pleace select a choice: " ); string enter = Console .ReadLine(); if (enter = "1" ) { for (i = 0; ; ) { sum = i * i; i++; if (sum > 500) { break ; } Console .Wri ...Show All
Windows Forms Populating a Listbox with (SQL Server 2000) and visual basic .net 2003
hi! I want to populate a listbox but wit (SQL server 2000) database, i just want to display 2 colums name and ID. and when I select a item I want to display the info of that table to several textboxs each of them coresponding to the table of clients that I have. how could I do it, got any example about it, thanx Hi, Connetion -> DataAdapter -> DataSet -> Set listBox.datasource and displaymember. Another post related: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=651724&SiteID=1 ...Show All
Smart Device Development Proxy Connection
hi! i have some problem with the setup of proxy of my smartphone. i want to direct all the traffic of all my programs of my smartphone to a specific port of the smartphone. can i do it how can i setup a proxy connection to the same smartphone to a specific port (how can i setup the proxy to do this ) if i set the address to: 127.0.0.1:xxxxx it should work yes, i have a program that listen the specific port and recive the data. but my problem is setting the "Connect From:" and "Connect To:", i don't understand how it should work. ...Show All
Visual Studio Visual Studio 2005 refuses to use Try-Catch block
I have a section of code surrounded by a Try-Catch block and the catch is just for a System.Exception, so it should catch everything + the kitchen sink, however, Visual Studio is still breaking into the code at the line causing the problem and showing me the dialog box I have the checkboxes cleared on the Exceptions list so it should not break on CLR exceptions, Native Exceptions, etc, yet it breaks in and shows me an argument exception at the line causing the problem I don't have a funky machine.config or app.config file either that has anything in it that would affect the behavior of the debugger. Why does visual studio refuse to go to the catch block I am using VB.NET I am not sure about other exceptions because I' ...Show All
