2326ac's Q&A profile
Visual Basic Array.BinarySearch Question
Hi, i am tring to validate my user inputs by checking what Key they press, so on the KeyDown event, i did like: Private validDecKeyCodes As Keys() = {Keys.D1, Keys.D2, Keys.D3, Keys.D4, Keys.D5, Keys.D6, Keys.D7, Keys.D8, Keys.D9, Keys.D0} If Array.BinarySearch(validDecKeyCodes, e.KeyCode) < 0 Then e.SuppressKeyPress = True AlertMessage("Value entered is not a valid Decimal value (0 - 9)", control, "error") 'AlertMessage is a custom function End If i find that although i press "0", which is Keys.D0,in the Array, the result of binary search is -1, why is this so i thought if its -ve, is is because it is not found oh ya forgot that. thanks, and if i put Keys.D0 f ...Show All
.NET Development Binary Deserialization and Generic Collections
I'm just updating an application that was using DictionaryBase collections to use the Dictionary<K, V> generic collection and all works fine (including serialization) with the exception of the Deserialization. I make the collection class itself derive from Dictionary<K, V> rather than setting up a Dictionary<K, V> collection object in the application itself - thus it looks like this: [ Serializable ] public class Customers : Dictionary < string , Customer > { } The desrialization code looks like this: IFormatter Serialize = new BinaryFormatter (); FileStream LoadCust = new FileStream (pCustFile, FileMode .Open, FileAccess .Read); HireCarCustomers = Serialize.Deserialize(Lo ...Show All
SQL Server T-SQL to delete files from Backup Device
I created a backup device and a job to backup a full dbs and transaction logs. When I first created the backup statement it was created with RETAIN DAYS = 10 Its been 15 days and the ones created after 10 days appear to be marked for deletiong but I am obviously missing a statement in my backup statement or in another job I need to schedule to come through and delete the old files from the backup device. Please help me figure out what this statement needs to be. All the backups and T-log backups are written to one device which is one file. Thanks Scott Remember that the backup device that we're talking about here is really a single file on disk. The "files" that the backup and r ...Show All
Visual Basic unable to create exe with multiple forms
Hi, I have a VB application with 2 normal forms and 2 dialog forms.I am not able to create an exe of it.I tried with File->Make option.It creates a scrap clickable exe which fails to load.Could anyone please tell me the possible problems. Regards, Swapna Is this VB6 that your trying to use, as I seem to recall Make was an option rather than a build in .Net When you say the craps a scrap clickable exe. Are you trying to run the EXE on the same machine as the development machine or is it a different machine. If its a different machine, then there may be other required files that you may be missing . In VB.Net applications, the .NET framework must be present for the applications to run, in the case of older versions of ...Show All
Visual Studio Express Editions Visual Basic 2005 - Databinding not updating the database
Well I had a tough time trying to resolve this issue and always thought that there is something wrong with my computer or the software itself. Then after searching the forum i found out the solutions to this problem. the solution is location in the link here. This is a blog about working with Local Data File: https://blogs.msdn.com/smartclientdata/archive/2005/08/26/456886.aspx . Quoting from this blog Where is my data -- Understanding the file copy for desktop projects But i didnot understand it properly. my project is created in the visual basic 2005\projects\ MAK folder, where MAK is my referred project created by me. There is one database file i.e. MAKdatabase.mdf located in project\mak\mak folder ans another one in the folder ...Show All
Visual Basic capture print job
hi, my purpose is to get the print job which was given in ms-dos base software. how to capture a print job from lpt port or how to get a print job in windows. bye ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Rectangle collision detection help
Hi, I'm learning how to use collision detection in sprites, and I've decided to use Rectangles. Basically, I program the game to make a rectangle around each of the 2 sprites and, when I move the sprites via keyboard input, it moves the box with them.( Now, I'm doing this to test collision detection. Heres the bit of code that doesn't work: if(Sprite1box.Right == Sprite2box.Left) { Sprite1pos.X += 5; Sprite1box.X += 5; } (Where Sprite1box = The rectangle aroudn the first sprite, Sprite2box = the rectangle around the 2nd sprite, and Sprite1pos is the vector of the 1st sprite) This doesn't work - the sprite just moves right through the second sprite. Now, I figured I must've done something wrong ...Show All
Visual C# Learning how to call form components
I want to read up on how to do things like.. CheckBox chk = panel1.Controls[ i ] as CheckBox; anyone has any tutorials for this Like were did you learn how to declare codes like this Also is there another way to select certain childs from a certain parents So you mean.. that a Control(Panel) that can hold other controls (ie check boxes.) can be declared this way also I might not make sense here but, in your example you checked to see if the checkbox was checked.. what If i just wanted to see if it was a checkbox becaue I see that your using the "as" to add all checkboxes in to ctrl, correct ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Stuck with Express only release...
It is ok for me that XNA is intended for Express... but why is the Managed DirectX 2.0 dicontinued I ported all my code to MDX2.0, I plained to move to XNA as soon as possible. But I cannot change yet because I'm using Source Safe to work at several places, and there is no SourceSafe integration in C# Express... And I cannot run my current version because MDX2.0 launches an Exception at startup. My only option is to port back to MDX1.1... but I really don't want to have all this extra work to just port it to XNA in a few month... During this time I'm stuck. Or I have to move to express, without SourceSafe and Resharper. My work will slow down drastically and I have already only few time to spend on it. Could you just re-releas ...Show All
Visual Studio Team System Vsts COnnection Problem
When i try to connect to TFS server it is not connecting instead i am getting "Client found response content type of 'text/html; charset = utf-8 ' , but expected 'text/xml'. The request failed with the error message:- bring up one of the tfs urls in the browser. My bet is that the webserver is blowing up with an error or you are getting a "Page cannot be displayed" message, since I've had the same thing happen to me. ...Show All
Smart Device Development Problem creating NDISUIO handle
Hi I am having a problem creating a handler for pocket pc. Below is a snippet of the code i am using. It works perfectly in WinXP but not in Windows Mobile5.0(Dell Axim X51V) I had changed the pinvoke to use coredll.dll for pocket pc. private const string NDIS_FILE_NAME = @"\\.\\Ndisuio"; DriverHandle = CreateFile(NDIS_FILE_NAME, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, INVALID_HANDLE_VALUE); DriverHandle returned is -1 which is INVALID_HANDLE_VALUE. After the create file i got error code 161 which is "ERROR_BAD_PATHNAME - The specified path is invalid." Is my path to Ndisuio incorrect Or anyone know what is wrong Thanks in advance. It mention ...Show All
SQL Server How to write this function
How can I write a function that accepts a data as a parameter and if the date is Last Monday in May or First Monday in September or 4 th Tuesday in November returns true otherwise returns false. Thank you very much for your reply. Can you explain me a little bit more, how confident should I be that last Monday in May would be between 25 and 31 of May for example And other date ranges ...Show All
SQL Server ProcessAdd for dimensions
I'm poking at some code that sends uses an XML/A ProcessAdd command to incrementally process a dimension. The command contains the out-of-line binding which specifies the query for the new rows. However, when the command gets submitted, I don't see anything that looks like the specified query in the profiler log. As I figure it, either: a) The command isn't constructed correctly. SSAS is claiming success, and the dimension is processed at the end, so if the command is wrong, then I don't know what SSAS would be doing instead (a full process a process update ). b) My expectation of seeing that query, or something like it, in the profiler log, is wrong. We also have ProcessAdd commands for partitions, and those queries DO end up being displa ...Show All
Smart Device Development How to determine if phone has SMS capability?
Hi. I am using VS2005/VB.Net and CF2 to write applications for Windows Mobile 5 Smartphones. I'm developing an application that relies on the phone having the ability to send and receive SMS message. I believe (but I could be wrong) that in some countries, and/or with some network providers, that the ability to use SMS is something that must be "turned on" by the network provider and/or setup within the phone. Therefore, I would like my application to be able to confirm that SMS is enabled and working on the phone, and if not, inform the user appropriately, rather than the user thinking that my application isn't working as intended. So, is there a way to programmatically determine if the Smartphone has the ab ...Show All
Visual Basic Need help with settings that won't synchronize
In my application I use the Project Properties Settings. So far, when I made significant changes to the settings, I used the synchronize button to activate the changed settings. However, this has now stopped working. When I press the synchronise button , a message comes up listing a lot of directories where it did not find " user.settings ". BTW, a file search does not find any user.settings either. However, when I run the program (in debug mode) it loads the same filename saved in the previous settings. For example, I have a setting called " My.Settings.DataFilePath ". It is set to nothing in the settings, but when I run the program it finds a file name previously saved in " My.Settings.DataFilePath ", but I ...Show All
