TarPista's Q&A profile
Windows Forms Closing Form
When a user clicks the X on the forum to close it. I would like to ask 'are you sure you want to stop playing' before shutting down. So how can I do that I made this code and it now shows 2 times the messagebox don't see why it does it twice: private void Form1_FormClosing( object sender, FormClosingEventArgs e) { DialogResult dlgResultStop; dlgResultStop = MessageBox .Show( "Are you sure you want to stop playing tetris " , "Stop tetris " , MessageBoxButtons .YesNo, MessageBoxIcon .Exclamation); ...Show All
Visual FoxPro Cannot execute program outside VFP9 IDE.
I have built my VFP9 application into both .app and .exe files and when I execute them, the VFP9 IDE starts up and runs the program inside of the VFP9 programming environment. As a result I cannot see how the program behaves on its own as if it were installed on a client's machine who does not have VFP9 installed. Could someone please indicate how I can run an application on its own without it having to run within the VFP9 IDE Thanks Hi, To hide VFP main screen, you can put code below at your main prg _SCREEN.VISIBLE = .F. Or Create file called config.fpw, put the following and include into your project SCREEN=OFF Do make sure that your main screen is set TOP LEVEL FORM. Otherwise, you will not able to se ...Show All
SQL Server FYI: Using Try's with Finally
Within my script component I was having some difficulty getting nested Exceptions to bubble out of the script component logic. The symptom appears when you get an ex.message of "Object reference not set to an instance of an object." As soon as I removed the Finally section my message (or the actual Exception object) was properly passed to the caller. I've only done minimal work with Try/Catch/Finally structures. Is this normal Thanks, Jeff Tolman E&M Electric Is the sqlReader variable initialized Most likely, when the first exception occurs, sqlReader is not assigned anything. So when you try to close null object, you get the new "Object reference not set to an instance of an ...Show All
.NET Development System.IO.File.Encrypt()
I would like to know what specific encryption algorithm (TripleDES, SHA1, RSA, etc.) this method uses. MSDN says: "Both the Encrypt method and the Decrypt method use the cryptographic service provider (CSP) installed on the computer and the file encryption keys of the process calling the method." Can anyone explain to me what they mean by the CSP installed on the computer and if there is any additional documentation this Thanks! This is the default encryption algorithm that is also available through the properties window of a file. You can let Windows encrypt the file. This is an NTFS feature. The algorithm are the following: DESX (Windows 2000 onward), Triple DES (Windows XP onward) ...Show All
Software Development for Windows Vista Database for samples ?
Hi Where can I find database for samples from netfx3.com I was looking in workflow's samples and some of them need database but it's not provided. So where it can be found Jedrzej I've found it already I made stupid mistake when I was unpacking file... I had a lot of files in my current directory but I thought it'll give me another nice directory. When I saw dir with name ExternalRuleSet I was 100% sure it really created catalog and full content of the executable is there. But I got another example and I noticed it doesn't create directory :) so... Thanks ;) Jedrzej ...Show All
SQL Server comparing DateTime in UK Format
Hello friends, I am trying to return all records between 2 dates. The Date columns are in DateTime format, and i am ignoring the timestamp. The user should be able to input UK Date Format (dd/mm/yyyy) and return the rows. This sql code works fine for American date format, but i get an error: converting from varchar to datetime when i put in a UK format. eg. 22/11/06. Please advise on this problem! many thanks! ALTER PROCEDURE SalaryBetweenDates ( @WeekStart datetime, @WeekEnd datetime ) AS BEGIN SET @WeekStart = (SELECT REPLACE(CONVERT(DATETIME,@WeekStart ,103),' ','-')) SET @WeekEnd = (SELECT REPLACE(CONVERT(DATETIME,@WeekEnd ,103),' ','-')) END BEGIN SELECT s.StaffNo,s.StaffName,s.StaffAddress, s.HourlyRate, sh.HoursWorked, CONVER ...Show All
Windows Forms Help me - Value
Hi my friends I'm with a problem. I have 2 radiobutton 1 is female other is man now I have that put the value of 1 and 2 and put in my column only that the variable only put 1.. please see me code... string sexo = "'" + radioButton1.Text + "'"; string [] texto = new string [2]; texto[0] = radioButton1.Text; texto[1] = radioButton2.Text; What I have to do here.. Thank you! is this not the exact same as this: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=648417&SiteID=1 with the solution given if not - can you please rephrase the question as it is not exactly clear what you want to achieve ...Show All
SQL Server Force to complete query, ignore errors
Hi, I have a big table and want to make a plausibility check of it’s data. Problem is, that my query stops, if there is an unexpected datatype in one of the rows. But that is it, what i want to filter out of my table with that query and save the result as new correct table. How can i write a parameter to my query SQL Code, that if a error occurs, the querry resumes and the error line will not displayed in my final querry overview In my books and on the net, i don’t found something to this theme ;-(. Thx in advance. Hm, what u mean with avoid inserting bad rows The bad rows are allready in my base txt-Files. But they are too large, to check and delete there every single line with the hand. I don’t ...Show All
Windows Forms Monitoring Changes on a Tab Page
In my WinForms app I have a tab page with a bunch of controls on it (e.g. textboxes, checkboxes, buttons, radio buttons, etc.). Is there an event, or a few events, of the tab page that I can monitor to see if any changes to any controls on the tab page have been made Robert W. http://pocketpollster.com There's things you can do, like iterating through the tabpage's Controls collection and calling AddHandler for their events. However, different controls have different events and different event handler signatures. You'll need some commonality between the controls (like "Click" is usually available). What specifically are you looking for when you say "anything happened" Also look into ...Show All
Smart Device Development [C# WM 5 CF 2.0] Incoming call manager
Hi, I read that some events could be send when a incoming call/sms/e-mail froms the Microsoft.WindowsMobile.PocketOutlook.MessageInterception.MessageInterceptor for sms/e-mail and Microsoft.WindowsMobile.Status for incoming call. My question is what's happen : 1- For sms/email I intercept the message and I can choose if he goes in the Inbox or not Or i just see him passing and i can't do anything on it 2- For an incoming call, a event is raised, I catch it, and check the incomming phone number but can in overwrite the incoming call manager of the phone i.e dispaly my own" incoming call" box and be sure that the native "incoming call" box won't be raised Tks The windows mobile te ...Show All
Visual C# How to create a new object of an unknown/changing type?
For a couple of days now, i'm stuggeling with the next problem: Let's say i have an abstract class called "car". From this this class i have derrived the classes Audi, Austin, Bentley, BMW etc. abstract class car { /*...*/ } class Audi : car { /*...*/ } class Austin : car { /*...*/ } class Bentley : car { /*...*/ } class BMW : car { /*...*/ } //etc. Now i create an array: car [] cararray = new car [10]; In this array, there can be every derrived (car)class. Now i want to create a new object carfromarray, which has the same type as cararray[0], but i don't want a copy. One way to do this is: car carfromarray; if (cararray[0] is Audi) { carfromarray = new Audi() ...Show All
SQL Server Filtering DB
I have SS Management Studio on my desktop that connects to a SS 2005 hosted by a web host. Since there are many DBs hosted by the same web host, I see them all (though I am not authorized to them). So, I've to search my DB in the Object Explorer. How do I filter the list to see only DBs that are mine Object Explorer in Management Studio does not support filtering databases at "Databases" node. Could you please log this issue as a feature request through Connect web site https://connect.microsoft.com/SQLServer/Feedback Click on Submit Feedback Thanks Sethu Srinivasan SQL Server Manageability Dev Team ...Show All
SQL Server Unable to cast COM object of type 'ADODB.CommandClass' to interface type 'ADODB._Command'
I have an application which runs successfully on a couple of my customer's machines but fails on a third. It seems to fail when opening the database: Unable to cast COM object of type 'ADODB.CommandClass' to interface type 'ADODB._Command'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{B08400BD-F9D1-4D02-B856-71D5DBA123E9}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)). Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=false; Initial Catalog=lensdb;Data Source = SQL Before I got this error I was getting another problem (sorry didn't make a copy of that error's text) that made me think that adod ...Show All
Visual Studio ReportViewer Conditional Formatting Anyone?
Hello, I'm completing an application based on VB2005/SQL2005 Standard using ReportViewer. According to the documentation (see http://msdn2.microsoft.com/en-us/library/ms252095(VS.80).aspx ) conditional formatting is supported. However, when I attempt to implement this, the report text is not formatted, but the color specification text is printed as in "Red", instead of the number printed with red color. I am obviously missing something here - any help is much appreciated. My customer specified conditional formatting in the requirement doc, so it is actually rather important to me... Thanks again! Atle Sorry, I should have read the doc a little closer - I found the reference to setting the Color property ...Show All
Visual Basic Colour Combo Box
Hi, How do i get a combo box to display system colours As i am using it so the user can select the background colour for a graph. I have tried colourcb.text = color() but this produces an error any ideas Andy Make this change to fix the code: Private Sub Update_ColorList() Try Me .Items.Clear() Dim zArrayList As New ArrayList(40) zArrayList.Clear() The Sub New() and the ColorsToShow() are both calling Me.Update_ColorList when the control is initialized and because zArrayList already exists, the code is not waiting for another new one to get initialized. Edited comment: Well it fixed it in one test. Now I don't know .... ...Show All
