Kelbob's Q&A profile
Windows Forms Validating data in a bound datatable
I want to validate data for a datatable bound to a datagridview. To cancel an edit for bad data, from what I can tell from the MS docs, I can set the columnerror or throw an exception in the handler for the columnchanging (or rowchanging) event. I tried throwing an exception and that works fine when I do the edit programatically. Ie, try > add a row of bad data > catch exception. But where do I catch the exception when bad data is entered into the DGV The dataerror event of the DGV gets errors from ConstraintException, NoNullAllowedException, and ArgumentException - this works fine. Is this supposed to get the exception that I throw too I am throwing an ApplicationException. Is this right I can catch the exception right afte ...Show All
Smart Device Development Tray icon with menu
I'd like my application to just consist of a tray icon that shows a menu of actions when it is clicked. Preferably the icon would be at the top next to the volume, time, etc. but I could live with it at the bottom. I've seen this behavior in this Magic Button program: http://www.trancreative.com/mb.aspx So far I have been able to load an icon at the bottom, but I haven't had any success moving it to the top bar or producing a menu when clicked. If anyone can provide pointers on how to accomplish this, it would be greatly appreciated. ...Show All
Visual Studio Express Editions Setting up ajax
Hello, I have setup the webconfig file with the httphandler for the ajax wrapper, then i also placed the ajax.dll into the bin folder, added a reference to the dll, and used an example that is super simple to test it. but i receive the following message. Compiler Error Message: CS0234: The type or namespace name 'JavascriptMethod' does not exist in the namespace 'Ajax' (are you missing an assembly reference ) Source Error: Line 5: } Line 6: Line 7: [Ajax.JavascriptMethod()] i'm not sure but my guess is somehow the web.config file isn't correct or something is messing up my setup web.config ---- -------------------- <!-- Web.Config Configuration File --> < configuration xmlns = ...Show All
Visual Studio Express Editions how to use standard method for keyboaed input
can u suggest me a standard method to input a character from keyboard with echo and without echo....like _getch() and _getche() functions. what i mean is these functions are supported by vc++ 2005 express edition but are non standard and hence the code and exe wont be portable. i know that in standard c++ there is no method for above problem .but i want to create functions which are standard and which i can include every time when i require keyboard input i.e i wanna make 2 functions equivalent of _getch() and _getche(). kindly help nobugz wrote: _getch() and _getche() are ISO C++ conformant. The old POSIX functions getch() and getche() are not. I have seen that remark in the documentation for getch() and _getch() ...Show All
Visual Studio Express Editions Rename project
How do I rename a project Where exactly do you right click There are many files with the project name. I think this option is not readily available. ...Show All
Windows Forms DataGridView Parent->Child while Filtering
Im have 2 DataGridView's and have then attached in a parent-child manner using DataRelation and BindingSource. This part works well. In order to make my software more functional, I put a search function on the parent DataGridView. When I search, though, it breaks the connection that existed as parent-child, and the child no longer updates based on the row that the parent has selected. The problem lies in the way I am filtering my parent view, but I dont know any other way to do it or how to 're-attach' the parent-child relationship here is the code that breaks the connection and filters the parent view.... DataView filteredView = new DataView( dataSource.Tables["Customer"], "LastName='Richards'", "", Dat ...Show All
Software Development for Windows Vista how to find the designer associated to an activity
I have an activity and need to know, whether it is drawn below a given designer or above it. How can I get a reference to the designer, that is associated with an activity to get access to the Location information The designer class has an Activity attribute, but Activities do not have a Designer attribute. Perhaps a good suggestion for the next release You can't - but you should be able to from an ActivityDesigner - which is where you'd want to do anything like this anyway. IDesignerHost is a service you should be able to get from any IServiceProvider through GetService. ...Show All
SQL Server How to dynamically set the ServerPassword
I have an FTP Task where I have to set the server password at run-time. I have the ftp connection manager set up. What I normally do is configure the ftp server connection manager using a dtsConfig file but I can't do that in this case. I won't know the serverpassword until I get a parameter from the user. Thanks Brian. Yes, I do want to do it in the package because the package is being launched via dtexec from a generic web app that creates textboxes for the parameters. I would like to keep the web app generic and free of package-specific code. I created a script task and I set the password by getting the ServerPassword property from the ConnectionManager's ...Show All
Visual Basic Unknown problem
Hello! I am writing application which is server which communicates with client by socket. The server contains one form "frmMain" and one module "Module1". Module1 contains the following lines: Imports System Imports System.IO Imports System.Net Imports System.Net.Sockets Module Module1 Public Const BS_PORT = 8221 Private pfnWorkerCallBack As AsyncCallback Private soclistener As Socket Private socWorker As Socket Public Sub StartListening( ByVal Port As Integer ) Try Dim ipLocal As IPEndPoint = New IPEndPoint(IPAddress.Any, Port) soclistener = New Socket(AddressFam ...Show All
Visual Studio Tools for Office Deplyment of VSTO project with proper security
Hi, We have a VSTO 2005 tools for office application which internally refers some .NET 2.0 assemblies. Now these assemblies are all private assemblies. While deploying my VSTO application in client's machine it's giving me security error. How can I deploy my private assemblies with proper security so that our VSTO application can execute with thise private asemblies in different machine I have gone through an articale in MSDN "Deploying Visual Studio 2005 Tools for Office solutions using Windows Installer" but it says only about public assemblies not about private assemblies. We cannot make our assemblies as public assemblies since we are referencing Microsoft's applicationblock for exception handling which are private assembl ...Show All
Visual C# Firing events in child classes...
Hopefully somebody can explain why .NET will not allow me to do this... I have a class, NonStationary, which has a member CurrentValue, and an associated event OnCurrentValueChanged. Now, I have two classes which inherit from NonStationary: Joint, and Shaft. Inside Joint and Shaft, there are times when, if the user hooked the event in the application, the event will be fired because he/she has set a min/max value above/below the currentvalue. The problem is, is that I cannot check to see if OnCurrentValueChanged has been hooked (if it's null), nor can I fire the event from within the Joint or Shaft class. The error I get is: "The event 'OnCurrentValueChange' can only appear on the left hand side of += or -= (except when used from wit ...Show All
SQL Server restoring a db in SQL Server 2005
Hello, I received a backup Sql Server file and I am trying to restore it. When trying to restore the backup using SQL Server 2000, I get the following message: "the backed-up database has on-disk structure version 611. The server supports version 539 and cannot restore or upgrade this database. RESTORE DATABASE is terminating abnormally." After doing some research online, I figured out that the backup I received must be from SQL Server 2005. Therefore, I installed SQL SErver 2005 on my laptop (so now I have both 2000 and 2005 on my laptop).. I tried to use the restore database option in SQL Server 2005 ( SQL Server Management Studio) to restore my backup, and I get the same error message (written again below) as I did ...Show All
Visual Studio How to Uninstall Visual Studio 2005 Trial Version?
Hi, I installed VStudio 2005 trial version. After the end of the trial period, I don't know how to uninstall the product! I tried the classic way: Ctrl Panel / Add remove programs... But that doesn't seem to work. Thanks for help. When I try to launch VStudio, I get: Evaluation period expired... When I try to uninstall it, I also get the same message !! ...Show All
Visual Basic EnumKey don't work with Danish registry names
Hi. Having a big problem when i try to read some keys in the registry that contains danish characters. Hope some one can help me. First with this line i look up to find the name of the Outlook profile of the user: Set objreg = GetObject("winmgmts:" & _ "{impersonationLevel=impersonate}!\\" & _ strComputer & "\root\default:StdRegProv") strKeyPath = "Software\Microsoft\Windows NT\" & _ "CurrentVersion\Windows " & _ "Messaging Subsystem\Profiles\" ' get default profile name if none specified objreg.GetStringValue HKEY_CURRENT_USER, strKeyPath, "DefaultProfile", strProfile That goes well. If i put wscript.echo on the strProfile it reads it out fine. Also if the profile name contains danish aoa chars. But when i then try to ...Show All
Windows Forms Updating public value via pop-up dialog
Dear All, I have declared a public variable in my main form. Then upon pop-up dialog I want to be able to see the public value and update in the pop-up and later the update should be able to be seen in my main form. How to do it ya There are numerous ways to do this. Try passing "this" to your Dialog Form, so it would be something like this: public class MyDialogForm : Form { MyMainForm CallingForm; public MyDialogForm(MyMainForm oForm) { this .CallingForm = oForm; } private void MyMethod() { this .CallingForm.MyProperty = "xyz" ; } } And in your main form, you'd ca ...Show All
