Dr. Mojo's Q&A profile
Visual Studio 2008 (Pre-release) Binding ValidationRule mechanism
Context: 'AgeRangeRule' in 'ConnectedData\BindValidation' WPF examples (Nov CTP) WPF provides validation checking ('AgeRangeRule' subclasses 'ValidationRule') and reporting (based on the return value in 'AgeRangeRule') when validation is performed 'outside' of the setter property (see Nov CTP example). What about equivalent operations when validation is performed inside the property 'setter' (assuming an ObjectDataProvider) Question: - should this be avoided if not, - is an equivalent 'ValidationRule' class mechanism to be used - should one throw an exception in such a manner that 'ValidationRule' subclasses can be used as we ...Show All
Visual C# DataGridViewImageCell
I am trying to get the information from a windows form button cell clicked on a new DataGridView control. The button cell is bound to a datagrid with the record ID keyfield bound to it. Clicking the button would produce the chosen key for further operations. The code example I have is from MSDN: http://msdn2.microsoft.com/en-us/library/system.windows.forms.datagridview.cellclick.aspx My code as I used in my application as follows contains a cast which produces an invalid cast error. The example from msdn also produces a cast error. Does anyone have an example which works private void dGVHistoryChooser_CellContentClick( object ...Show All
SQL Server No access from Application to SQL Server 2000
I have installed the SQL Server 2000 and its up running. I can connect to the database direct as administrator, but my test application(asp.net 2.0) returns an exception. SqlConnection sqlConn = new SqlConnection( " data source=10.61.90.24;initial catalog=testdb;persist security info=False;user id=sa;pwd=data;Type System Version=SQL Server 2000;" ); sqlConn.Open(); I receive this exception: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connection ...Show All
.NET Development how to format xml string with an xsl stylesheet
Hi, I have a string that is in an xml format <items><num>5</num><text>sometext</text></items> I want to transform that string somewhow using my xsl document listed below and attach it to the body of an email. I was trying to use the code below but the xmldocument load does not take a string. How can i go about accomplishing this. XmlDocument docXml = new XmlDocument(); docXml.Load(sb.ToString()); XslCompiledTransform docXsl = new XslCompiledTransform(); docXsl.Load("xslFormats.xsl"); Thanks! Alex I 'm not sure what you are trying to accompli ...Show All
Visual C++ DWORD_PTR
I checked and tried what you both said. The declaration of windows.h was ok. I tried to compile the simple app with only a declaration of a DWORD_PTR #include <windows.h> int main( int argc, char **argv) { DWORD_PTR i; return(0); } Here's the errors (i disabled the precompiled option (/p) for this list) Thanks again Output Window Compiling... StdAfx.cpp Note: including file: c:\hydrotel\code\hydrotel_2004_07_09_console_avec_dll\hydrotel_2004_07_09_console_avec_dll\stdafx.h Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 8\VC\atlmfc\include\afxwin ...Show All
Visual C# Icon in Form
Hi All, I would like to make to change icon in the same form. By this means that the form has 2 functionality: when functionality is changed also icon must be changed in the same form. Is there any ideas for solving the problem Many Thanks. Hi all the problem is how to implement changing the current form icon property In case of .Net 2005, it is fine to change icon by adding icon in folder of resource, but when I try to add in .Net 2003 it is not. if ( this is form B, pop-up form A) { this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); } else this.Icon = ( ...Show All
Visual Studio cannot add code behind files
I have created a new project template and it includes a custom webusercontrol. It is a custom control because I have added code to the associated code behind file. When I add the custom code behind file to the project using the AddFromTemplate, I get a message that the file already exists etc... The code behind file does exist because Visual Studio added it when it added the ASCX file. Ideas anyone If I have custom code behind files, how should I add them to a project I like the idea of listing the file in the Template.Inf file. Thanks, Jason ...Show All
Windows Forms Design mode of custom control hosted in UserControl
Here's my problem. Throughout my code in a custom control I check to see if it's in design mode. If it isn't I don't do anything, if it's not then I do. (I have to do this because I'm using MSHTML and it works as soon as you create it regardless of mode.) This works great if the control is hosted on a regular form etc. but  ...Show All
SQL Server HelloWorldCS Sample
Is anyone is familiar with the HelloWorldCS solution that is available for download at www.SQLServiceBroker.com If so, can someone tell me what this method does ------------------------------------------------------------------- private void BuildCallbackMap() { Type t = GetType(); //this member variable is for retrieving a collection of key/value pairs //BrokerMethodAttribute is a base class for all custom attributes m_dispatchMap = new Dictionary<BrokerMethodAttribute, MethodInfo>(); //get all public methods of Instance type... MethodInfo[] methodInfoArray = t.GetMethods(BindingFlags.Public | BindingFlags.Instance); &nbs ...Show All
Visual C++ setting compiler options programmatically.
I am trying to simplify my life and set up all compiler options programmatically in a single file where I will see what is going on. I created a .cpp file and copied an MSDN function in there that is supposed to do it. My intention is to call this function eventually from the main routine. So far all attempts to compile the file failed with the errors described below. First the code: using namespace System; using namespace System::Object; using namespace System::CodeDom; using namespace System::CodeDom::Compiler; using namespace System::CodeDom::Compiler::CodeDomProvider; using namespace System::String; using namespace System::Object::Micro ...Show All
Visual Studio Express Editions Minidumps and Express
Are minidumps fully useable with Express Editions, or is the help file correct when it tells me that the topics on minidumps do not apply to Express, only to Standard and Pro/Team I'm asking because I can load a .dmp in VC++ Express, but I don't get a useable call stack, no disassembly and no symbols. All modules are loaded as "No matching binary found" in the debug log. Does this mean I do something wrong, or are minidumps in Express crippled by design As an alternative maybe the debugging tools for windows might be interesting http://www.microsoft.com/whdc/devtools/debugging/default.mspx ...Show All
Software Development for Windows Vista SqlWorkflowPersistenceService exception using beta2
Hi, I've tried to created a web application using workflow. but there was an exception (array index out of bound exception) occurred when i tried to call 'startRuntime()'. Here is the code: --------------------------------------------------------------------- private WorkflowRuntime runtime; private WorkflowInstance instance; private AutoResetEvent waitHandle; and in button_click(): runtime = new WorkflowRuntime (); waitHandle = new AutoResetEvent ( false ); SqlWorkflowPersistenceService sqlService = runtime.GetService< SqlWorkflowPersistenceService >(); if (sqlService == null ) { ...Show All
SQL Server alter column b/w desired column
if i have structure of table like a,b,c,d,e column then i want to alter one more column x b/w b and c column, so that a,b,x,c,d,e Do you need to add the column to the table or do you want to do something with the records ALTER TABLE testTabelle ADD x NVARCHAR(20) I don't know if the position of the column could be defined but is it really needed You can always define the position on quering: SELECT a, b, x, c, d, e FROM testTabelle ...Show All
Windows Forms How to add a new line inside a textfield...
Ok i'm trying to add a file list into a text field so i can cut and paste... I don't want the file list to be in one continues line, so I'm appending "\n" to the end... This works BUT I get the new line character displayed on my screen as well... this is my code foreach(object i in this.checkedListBox1.CheckedItems) { Ez ...Show All
Visual Basic Missing a DLL? A vital one?
Ummm. I think this is a newbie question.... Well, I made a program... Then I copied it onto my JumpDrive... Then I excuted it onto someone else's computer to show him what the program was... Then there is like a popup telling me that a DLL is missing... Although I copied the whole project folder on to my JumpDrive... What's happening Thank You Keehun Nam KN1123, If you have time, I suggest you to read some book concerned on the .NET Framework such as Applied Microsoft .NET Framework Programming wirriten by Jeffrey Richte and you will have a better understanding the problems caused by DLL. ...Show All
