Derek Comingore's Q&A profile
Windows Forms Form focus problems
I've got the following problem: I've written a WinForms problem (.NET 2.0), which has a UserControl with a few buttons on it. The form has a KeyUp Event to trap keyboard events throughout the app (works with a barcode reader). After pressing the button, and scanning a barcode (i.e. capturing several number key-presses), the keys are remembered, but the following enter (appended to each scan) is captured by the button I previously pressed as a click. This remains true as long as I don't change the focus to a control that doesn't grab an "enter" key, such as a checkbox. Is there anyway I can avoid this behavior, preferably by disabling the buttons "enter-trapping" behavior ...Show All
SQL Server Primary Key Question
I have been developing a .NET Web app with an SQL Server 2005 Express database. Since I've been testing insert and delete code with a large data source, the Primary Key column which is also an autoincrement integer column is now at very large numbers (starting at over 40,000 now). I've tried doing a shrink on the database, but other then reducing the database size, it has done nothing to reduce the Primary Key numbers. Is there a command way to reduce the starting number back to 1 or do I need to completely reconstruct the database from scratch TIA Thank you, Sir. Yes, it did work and in the process I've learned more about SQL Express and T-SQ, important for a relative newbieL. Not onl ...Show All
Visual Studio Express Editions WinFX-WPF Screensaver
I am a beginner at C#, and want to make a screensaver in WPF. Has anyone got any tips on how to code a screensaver that would work on multiple screen resolutions (scaling, but keeping aspect ratio) Or does anyone know where I can get sample code for this Hi mrmckeb, Have a look at http://www.netfx3.com/ this is the home of the whole .Net3.0 (formaly WinFX). Hope this helps Scott ...Show All
.NET Development getRequestStream() throwing SocketException
Hello, I posted this in another forum but I believe it may have been the wrong forum to find the answer I am looking for. I am still very much a novice when it comes to .NET and programming in general so please excuse my naivete. I have a Windows Mobile 5.0 app written in Visual C# - .NET CF 2.0 I had a very simple login program that would query a MySQL database on a server and return some info about the user logging in. This code was working fine a couple weeks ago, and I got sidetracked to another project. Well, today I went to do some more work and I noticed that I could no longer login. My database was accessible and my login info was correctly entered. So I did some debugging and noticed that a line of code I had was throwing ...Show All
Windows Forms how to make the save and exit buttons visually exactly the same
Good mourning from Seville (Spain), I would like to know which is the best way to do two buttons exactly equals. The same size and separation between them, and i want it to be easy to drop in all my forms (more than 30...). Thanks in advance. Put them in a UserControl, then drop that control on each form. Better yet, design a base form with those two buttons, then derive all your other forms from that base form with Project + Add New Item, Inherited Form. ...Show All
SQL Server How can I synchronize 2 stored procedures
I have 2 storeds A and B. in Stored A, I pass a Table and update values into the Table after stored A complete, Stored B will use all values in the table to compute something. But when I run 2 storeds, I cannot synchronize 2 storeds: stored B always start when stored A is running .How can I make sure the store A complete to start stored B. Is there any thing to do that. I commans as: exec sp_stored A @iP, TableTemp exec sp_storedB @sIP, TableTemp I guess you could wrap them in Transactions. Or just call second SP at the end of the first store procedure within the SP. Or have a trigger on first table that runs on AFTER UPDATE and bypass second SP altogether BEGIN TRANSACTION exec sp_stored A @i ...Show All
Visual Studio Team System Mapping information could not be obtained from User Name Mapping?????????
Hi, my connection to TFS works randomly. For a while I can connect fine, but for a while I can't. If I check the events I can see the following: Mapping information could not be obtained from User Name Mapping. Any ideas why this is happening Check whether the following helps http://support.microsoft.com/kb/925637 ...Show All
Visual Basic Opening Other Applications
What would the code be (to put into a button) for opening another application I need to launch the calculator....located at: C:\WINDOWS\system32\calc.exe This is what I have so far... Private Sub Command1_Click() Process.start (calc.exe) End Sub But this always gives me "Run-time error '424': Object Required I'm using Visual Basic 6.0 thanks if you can help Process.Start is the way you would do it in VB.NET, to get this to work in VB6 you want to do this: Private Sub Command1_Click() Dim x As Integer x = Shell("c:\Windows\sytem32\calc.exe") End Sub Hope that helps, Jonathan ...Show All
Visual C# Disk Partition Volume Names
My C# application has to pull information on the last partition on the first physical disk drive. If this partition is associated with a windows drive, I have no problem. However, if the partition is not a windows partition (ex: Dell's restore partition), I cannot get information on it. The main piece of information I need is the label. If I look at the non-windows partition in Disk Management, I see the label. Is there a programatic way to get this label for a non-windows partition. Here is what I have done so far: 1. looked into getting it with WMI and found nothing. 2. looked into using the GetVolumeInformation() method in kernel32.dll. 3. looped through volumes using FindFirstVolume() and FindNextVolume in kernel32.dll. ...Show All
Visual Basic color chart at design time
Where can I get a color chart that shows the VS KnownColors, to use at design time I want to define a set of color schemes, with colors that I can select visually. I have found some stuff on the internet that gives the RGB values, but I need the VB KnownColor names. Thanks in advance. Johan, Thanks for the reply and applogies for my delay in responding, I missed the alert. ColorEditor does not seem to be what I want. I simply want some tool that will show me a palette of colors at design time, from which I can paste to my code. I think VB 6 had such a window. I am trying to fill in a (fairly extensive) number of enums as follows; Enum ColorScheme1 As Integer LnBaseColour = KnownColor.DarkRed LnParColour ...Show All
.NET Development DataBinding and DataSet
Hi, im trying to read data out of my SqlDatabase, list it in a Textbox, and when you press a button the data that could be changed will be updated so this is what i got: private MySqlConnection m_objConnection = null ; private DataSet m_objDataSet = new DataSet (); private MySqlDataAdapter m_objDataAdapter = null ; private MySqlCommandBuilder m_objCommandBuilder = null ; private BindingSource bs = null ; public Form1 () { InitializeComponent (); m_objConnection = new MySqlConnection ( "..." ); m_objConnection . Open (); m_objDataAdapter = new MySqlDataAdapter ( "SELECT name FROM users WHERE username = \"Koen\"" , m_objConnect ...Show All
SQL Server "Microsoft SQL Server 2005 Datamining Viewer Controls" feature pack
Hi, I downloaeded "Microsoft SQL Server 2005 Datamining Viewer Controls" feature pack, and tried to run the dataminingviewerclient.exe. When i view my local time series data mining model, It works well for single series model, but when i load a Microsoft time series model containing multiple data series, an unhandled exception occurs. I post the error message below: See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.AnalysisServices.Viewers.TimeSeriesViewer.PreprocessChartArrays(ArrayList rgPredicted, ArrayList r ...Show All
.NET Development C# TCP Remoting Security Exception
Hello, i'm having an issue with remoting... i'm attempting to create a simple chat application, where client(s) connect to a server and messages are sent back and forth (using windows forms)... I'm using events and delegates to initate the changes to the textboxes, the messages sent from the client to the server will show up fine, but if i try to create a new event handler from the remote object i get a security exception. I don't know much about security, so i was hoping someone can help me out... i'm not using a config file to set up remoting (one more thing that has to be with the program) here is the direct paste from the exception i'm getting. System.Security.SecurityException was unhandled Message="Type System.Delegate ...Show All
.NET Development Finding a record
Why can it be simple when it can be complivated :) I am trying to achieve something that was so simple to do with ADO recordset. Lets say I want to find a record that starts with a value typed by user in a textbox. Find method of DataTable will allow me to search in a particular column, but only for a full match. Also, does ArrayList have this search functionality Lets say that we have bound datagrid to arraylist, and want to search for a row that its column value starts with some value DataGrid cant search in its data, as far as I have searched in its properties and methods... Hi you can search in a datatable through a DataView. When you set the RowFilter property of the DataView then it fillter all t ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Texturing problem
Hello, I'm writing my own content importer for my maps. At the moment, I'm able to load all triangles and draw the map but i have a problem with textures. In my importer i load texture like this (it's just a test) : BasicMaterialContent material = new BasicMaterialContent(); String texturePath = Path.GetDirectoryName(filename) + "\\Textures\\wall.jpg"; if (!System.IO.File.Exists(texturePath)) throw new Exception("Texture not found !"); material.Texture = new ExternalReference<TextureContent>(texturePath); Then I apply my texture to a mesh : builder.SetMaterial(material); When I deploy it on xbox360 or run it on my pc, my mesh have a color similar to my texture but it's just a color! I ca ...Show All
