Tom_Tregenna's Q&A profile
.NET Development Using == null on Nullable type
I found using == operator to compare a Nullable variable with null always return false. Is it a bug on C# 2.0 Hi, Can you post the code you used to test the equality When I perform the following code, it says that it is null. Nullable < int > x = null ; if (x == null ) { Console .WriteLine( "null" ); } else { Console .WriteLine( "not null" ); } Greetz, Geert Geert Verhoeven Consultant @ Ausy Belgium My Personal Blog ...Show All
Visual C# 'eSc' key and pass word **** ?????????
I want to exit a c# command line program that i made by pressing only the 'esc' key. How can i do that thanks (make it simple!!!!) the last one would be a better solution than checking the actual key code value :-) It's better to do it the .NET way no offense V.Tortola ! :-) ...Show All
.NET Development How many ways can process.MainModule.FileName fail?
I am trying to acquire a definitive list of ways in which Process.MainModule.FileName can fail, and which are recoverable. Other than the two documented exceptions NotSupportedException and PlatformNotSupportedException, I have discovered, through web searches and experience, that several other failures can occur - generally due to either a) the process object not yet having been fully set up after the process start (in which case a Thread.Sleep(0) and a retry will eventually succeed), or b) because the process has terminated since the Process object was acquired. According to one website it can fail with an InvalidOperationException, possibly because the process has exited. It can certainly fail with a Win32Exception if MainModule is n ...Show All
SQL Server Dbmail sending mails but recognised as spam by outlook07 and spamassasin.
Just started playing with the server 05 demo I am trying out the dbmail tool/ sp. Problem is that mails are being recognised as spam! Emails are being sent as text. Both Outlook 07 and spamassasin recognise the mail as spam :S.... I sent same info via outlok and all is ok. Difference is the header. Has anybody come across this Know of a solution Thanks DBMail does not require Outlook or any of the client pieces that SQL Mail required. What SMTP server are you using Where are you sending the mail Paul A. Mestemaker II Program Manager Microsoft SQL Server Manageability http://blogs.msdn.com/sqlrem/ ...Show All
SQL Server can service Broker talk to informix
Hi, I am very new to Service Broker. Can I have a Service Broker which will Exchange Message from Informix and service broker sitting on SQL Server Box. If this is possible, How can we achieve it. Any Pointers will be very helpfull. Thanks Hello Remus, This seems fine for Informix installed on Windows, but in my case, I can have Informix on Unix Machine also. Therefore I want to have a generic design for both the cases, So that I don't have to do much of change when Informix is on Unix or Windows. That is the reason why I did not try to use Linked Server. Can a Service Broker Communicate with a service running on informix box. Thanks Dharmbir ...Show All
Microsoft ISV Community Center Forums Using Tabs in MSComctlLib.TreeCtrl.2 control
Ive set up a treeview using the MSComctlLib.TreeCtrl.2 control that has a series of information, currently seperated by commas and hyphens etc. Because of the proportional text used it all looks a bit messy. Is is possible to use tab characters to better lay out the displayed text of a node, if so how (I've tried Chr(9)). How would the tab spacing be set up etc. Thanks That's what I was afraid of. Thought of a fixed font, but they just look so unappealing Thanks for your reply ...Show All
Visual Basic link vb to fortran
I have several subroutines which are written in FORTRAN. Can anyone tell me in a step-by-step manner ... 1) how I need to compile the FORTRAN subroutines 2) what I need to do within VB 2005 to call these FORTRAN subroutines within the VB 2005 code This is probably an error with the dll. Can you do me a favor and open up a VS 2005 command prompt, navigate to the directory that contains your dll and then run dumpbin /exports simple.dll and let me know what you see -Scott ...Show All
Windows Forms BindingNavigator - Detail/DataGridView
I am quite new in VB I am trying to make a simple form with tables from a SQL database.I have three tables ( 1 parent and 2 children) shown as details. They areralated in a dataset with primary keys and FK. I have added two sets of data into thedatabase. When I run the application it works out fine, and I can shift between the two sets of datawith the navigatorbar. The three tables shifts correctly. However - when I add a new record into the application and save it, it is only the parent table that obtains the data. The two other tables become empty when shifting away - and back to the new record. I would be very pleased if anyone can help me out of this problem. I now found out that my application works out fine when the parent ...Show All
Visual Studio 2008 (Pre-release) There is no BindingNavigator in WPF?
When will it be provided Or please show me how to design one myself A BindingNavigator equivalent will most likely not be in the RTM version of WPF. However, I don't see why we wouldn't be able to create one. A BindingNavigator has a tool strip that handles adding, deleting and navigating data. I think it would make a good addition to the WPF Toolbelt but I'm running out of time for implementing new features in time for the September release. If I had another developer join the effort maybe it will be possible. *hint hint*. We can probably use a HeaderedContentControl to implement the control. The header would be the tool strip. And the content would be a panel containing the controls bound to the current item that the navigato ...Show All
SQL Server SQL Server Mobile with Visual Studio 2003
I've recently noticed the availability of SQL Server Mobile, and would like to take advantage of some of the new features, however, I'm currently using Visual Studio 2003. The requirements state that Visual Studio 2005 is required, but I was wondering if anyone has had any success getting it to work with VS 2003 I hope that I can do this with VS 2003, but if VS 2005 will be required, I'd like to clear up a few issues before asking my workplace to fork out more money for the upgrade: What have your experiences been like in getting clients to upgrade from SQL Server CE to SQL Server Mobile I've seen some postings regarding problems with specific devices which seem a bit worrying, but I was wondering how easy it was in gen ...Show All
Gadgets Keyboard State Gadget
Hi, I have a wireless keyboard that does not have status lights for num, caps or scroll lock, I want to write a gadget to show this however i cannot find any information on calling the API from javascript. If anyone has any ideas or examples on this i would be greatful. Ian Paskin As Scott states, you'll need a COM. Here's the code you'll need (VB). I haven't tried it, but I believe it returns 1 for NumLock/CapsLock/ShiftLock if they're on. Private Declare Function GetKeyState Lib "user32" (ByVal key As Long) As Integer Public Function KeyState(keyCode As Long) As Integer KeyState = GetKeyState(keyCode) End Function ...Show All
Microsoft ISV Community Center Forums Input from user form put into specified cell.
I need to set up a user form that when you put information in it and click the add button it will put it into a certain cell. Here is what I am trying to do. I have 13 generators and each one has a fuel tank that we need to keep track of how may inches of fuel is inside. In my user form I have a place for each tank. When the user clicks add on the form I want it to go into a specified cell. So if 13 is entered under Generator 1 that information would go under cell B2 (no matter how many times you change it. If it is for generator 1 it goes under B2). Generator 2 has an entry of 4, that would need to go into cell C2 and so on. Any help would be appreciated. If you are using textboxes on the us ...Show All
SQL Server No ADO type command for Data Flow?
I'm probably not looking in the right place, but all I could find when creating a data flow task was OLE DB Commands. I was trying to utilize a dataaccesslayer piece of code that we use every where in our projects, but because it uses ADO and not OLE DB, it caused an issue between the column data types. Is there an ADO command object available Or are we forced to use the OLE DB command object All I was looking to do was to Execute a SQL command. There's an object on the Control Flow level to do that, but not on the Data Flow level---not sure why that is. Thanks, Jeff Tolman E&M Electric Hey Jamie, I was just hoping to use our DataAccessLayer code library (which ut ...Show All
Smart Device Development How do I create a Timer instance in a console application in winCE
Hi I have a console app. that uses a timer to print out some sort of msg every x second. The same code compiles and works on windows console but not the Smart console. It gives me compile error on: Type 'System.Timers.Timer' is not defined This is how I create the timer Private CommReadTimer As New System.Timers.Timer(300) When I look throught the System namespace there is no Timer in the .NET CE framework 2.0 .....how can we create a timer Thanks You could use System.Threading. Timer ...Show All
Visual Basic Datagrid RowHeaderWidth changes to 15 when rebuilt
I have a read only datagrid in one of my forms. I use a context menu that has Edit to open another form to edit the values in the right clicked row. The editing form sets it's dialogresult to OK if the UPDATE SQL command terminates sucessfully. When the form with the datagrid is returned to it rebuilds the datagrid to reflect the edited changes. This includes setting the TableStyle which sets values such as the Column Width, Column Field Name (of the datatable) and the Column Name. After the Table Style is set datagrid parameters are set such as AllowNavigation - False, BackgroundColor, ReadOnly - True, and RowHeaderWidth. The RowHeaderWidth is 5, however, after this line is executed after an edit the RowHeaderWidth value sets to 15 ...Show All
