FreddyParra's Q&A profile
Windows Forms DataTable Expression Column
My DataGrid is bound to a DataSet, with following columns: Description, CashExp, CreditExp,Frequency On run time, I am adding two new DataColumn “AnnualCash” and “AnnualCredit” and defining Expression property to give product of two columns, as follows Dim dc As DataColumn dc = New DataColumn("AnnualCash", GetType(System.Single)) dc.Expression = " CashExp * Frequency"  ...Show All
Visual Basic I Need ASAP: Keyboard input
if i want to make a picture box move left, right, up or down what code do i use A simple example based upon keypresses on a form. Simple form with one button and picture box on. You are detecting the key that is pressed and moving the picturebox by adjusting the left and top properties. Public Class Form1 Private Sub MoveButtonAround(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp, Button1.KeyUp If e.KeyCode = Keys.Down Then PictureBox1.Top = PictureBox1.Top + 1 ElseIf e.KeyCode = Keys.Up Then PictureBox1.Top = PictureBox1.Top - 1 ElseIf e.KeyCode = Key ...Show All
.NET Development Formatting 100000 to display as $100K
Is there a format suitable to display 100000 as $100K I read that {0, 3} is a way to specify the width of the display number but this only pads the number extra spaces if it is less than 3 digits. {0:$###K} --displays the full number $100000K {0, 3} -- displays the full number 100000K {0, 3:N} --same basic problem 100,000K Isn't reasonable that one would want to display only the first few digits of a number Or only the last few digits Is there really no format for this Why don't you just use your first format and divide your number by 1,000 That way you have absolute control over how the result is rounded. Mike ...Show All
Visual C++ Candidate function(s) not accessible strange case
When trying to call a __gc class static function in an assembly which has CLR and non-CLR types in its signature, I get a Candidate function(s) not accessible error. In an assembly, using /clr:oldSyntax: TSEShared.h -------------- // TSEShared.h #pragma once #include <string> using namespace System; namespace TSEShared { public __gc class Global { public: static std::string ToCppString(System::String *); }; } TSEShared.cpp ---------------- #include "stdafx.h" #include "TSEShared.h" std::string TSEShared::Global::ToCppString(System::String * str) { if (str == 0) { return(std::string()); } System::In ...Show All
Visual Studio 2008 (Pre-release) LINQ CTP (May 2006) is here!
We have the new CTP for you on the LINQ home page . There is one combined MSI for VB and C# developers that contains plenty of goodies: lots of features that you had requested and we had planned in VB, C#, System.Query, DLinq and XLinq. New component - LINQ over DataSet. New samples, visualizers. I will leave it to you to explore the details and give us feedback. Thanks for your interest and excitement since last PDC. This is what keeps us going. Dinesh Kulkarni Program Manager - The LINQ Project ...I think you should support true many to many and you shouldn't have to map the intermediate table to a class. O ...Show All
Windows Forms how to indicate install location, program groups, short cuts etc.?
Using vs2005 (not express), how does one indicate where to install an application. What about dlls; how can they be installed into the windows system32 directory It appears that everything must go into a folder based on the Manufacturer property and subdirectory based on the installer project name. Can the developer choose another location If so, how Also, what about the program group and shortcuts under the start | all programs menu and desktop shortcuts; how to customize that part of the installation Where in the bol is this information located because I've yet to find it Right-c ...Show All
Visual Basic Now a question about audio resource playing
Hey, more questions for you all. I thought the new My.Resources thing was pretty cool, so I went in the resources designer and adding a WAV file. Next I go in code and put it down exactly as MS says to in the help file, they say this: "This example uses the My.Computer.Audio.Play method to play the sound stored as an audio resource named Form1Greeting in the application's resource file. Sub PlayFormGreeting() My.Computer.Audio.Play(My.Resources.Form1Greeting, AudioPlayMode.Background) End Sub -------------- Alright, looks easy enough. So I add my WAV file, called "mario" to the resource designer and save it. I go in my code an ...Show All
Visual Studio Express Editions Get Hostname from IP?
How can i turn like "67.171.62.83" into "hsd1.wa.comcast.net" In vb.net Use the System.DNS class and the GetHostEntry method to retrieve an IPHostEntry and then use the HostName property. http://msdn2.microsoft.com/en-us/library/ms143998.aspx Dim ipAddress As String = "67.171.62.83" Dim ipHostEntry As IPHostEntry ipHostEntry = Dns.GetHostEntry(ipAddress) Console.WriteLine(ipHostEntry.HostName) You can also use the aliases property to retrieve a list of names associated with the host if there are more than one. ...Show All
Visual Studio Team System how to access the branch statement to use in fxcop?
hi, i am writing a rule to check is declaration avoided in inside loops. For that i am checking is declaration avoided inside branching statements of MSIL. For that i need to access br.s and blt.s opcodes. I dont know how to access them... Can any one help me Thanks in advance... Hi Guns, loop detection and assignment inside loops is more complicated than just looking for branches. This usually is done with dataflow. Trying to implement this by just looking at instructions will probably be very tough. However, if you want to see all MSIL instructions in a method, use Method.Instructions. Each instruction object will hav ...Show All
.NET Development Code to Access a Template Column in a GridView
What code is used to access a GridView Item Template column to conditionally set the value of a label field contained in it The control names are "GridView2", the column name is "RequiresPWD", and control I need to set to "Y" or "N" is "Labele1". I need to test a SqlDataSource table field for 1 or 0, and set the value of "Label1" to either "Y" or "N" respectively. It is coming from "SqlDataSource2", table "Items", field "RequiresPWD". Thanks Never mind. I figured it out already. ...Show All
Visual C# Problem in getting handle using WindowFromAccessibleObject
Hi All! I am having a problem in obtaining the handle of a particular accessible object using WindowFromAccessibleObject. First, let me show you my code: private static string GetWindow(IAccessible iAccessibleControl) { try { ...Show All
Visual C++ docking windows
Does anyone know how to dock a window on the side of the screen Which technology are you using Win32 APIs, mfc, ..etc Thanks, Ayman Shoukry VC++ Team ...Show All
Visual C++ C++ activeX dll to be loaded on Web client
creating an axtiveX dll in VB6 for a web browser - which would run on the client's PC was very easy - use an activeX dll project and then use the setup and deploy tool which created the prototype html object to use. I would like to create in visual studio 2005 an activeX dll (not a control with displays) which just has write properties which is loaded to the client's pc. Using the ATL project I was able to create a simple dll - which I can reference it into a VB6 project and run it OK. Using the visual studio 2005 deploy I was able to create a CAB file for it. I have no idea how to get it into my web page as the classid etc. is ...Show All
SQL Server Forcefully Disconnect All Users and Drop a Database
Hey all, I am trying to write a function to drop a specific database no matter the connection status. I have tried con = new ServerConnection (sql); con.Connect(); Server srv = new Server (con); srv.KillDatabase( "Name" ); ,and also tried Database db= Database (srv, "Name" ); Database db=srv.Databases[ "Name" ]; db.Drop(); None of these worked. That surprises me because KillDatabase is supposed to disconnect all activity to the database, at least that's what it says it does. Thanks. Hi, that was worth a Blog entry, there you a ...Show All
Visual C# Determine startup file
Hi, I have created a file that works with my program. The extension is '.epi'. I want to load the file in my program when you click the file in Explorer So I created this code: if (( Application .ExecutablePath.EndsWith( ".epi" ) == true )) { string filename = Application .ExecutablePath; //Then the code to load the file using the above filename. } But this code does'nt work. I set in the register to start the file ending on ".epi" with my program, "EP-Intro.exe". Now, this code written above never starts because the Application.ExecutablePath always ends with "EP-Intro.exe". Now my question: Ho ...Show All
