ksimpson's Q&A profile
.NET Development inheritable singleton pattern for windows forms
Hello! I'm rather new to C# and developing my first commercial application in that language. It contains some forms, and only one instance of each form can exist in the running application. So, each form implements the Singleton pattern is such way: public class Report: Form { private static Report _instance; protected Report() { InitializeComponent(); ... } public static Form instance { get { if (_instance == null) _instance = new Report() ; return _instance; } } ... } So, this code is duplicated in every single form in my application and the only difference between forms is shown in bold in the example. I want to get rid of that duplication, for example, by defining a base clase which inherits ...Show All
.NET Development How come when DataGridView.enabled is set to false there is no change in visual appearance?
For most other controls when the enabled property is set to false, the text becomes greyed out but with DataGridView, I don't see any visual cues that the control is disabled. It does undergo a couple of subtle UI changes when enabled is set to false. For instance it's scrollbars will become disabled if visible. I'm not sure why it's not as aparent as other Controls (don't work on that team). ...Show All
Visual Basic Simpler Coding?
Is there a simpler, more efficient way to code the toppings section, while still maintaining checkboxes I am trying to get away from the multiple If/ElseIf/Then statements, if possible. Thanks! Private Sub btnOrderTotal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOrderTotal.Click Dim pizzaCost As Single = 0 ' Base cost of pizza, based on size If radSmall.Checked = True Then pizzaCost += 12.99 ElseIf radMedium.Checked = True Then pizzaCost += 14.99 ElseIf radLarge.Checked = True Then pizzaCost += 16.99 Else MessageBox.Show("Please choose a pizza size.") End If ' Add on a ...Show All
.NET Development which is the better data storage, XML or Excel
Hi, I am developing a windows application that requires constant connection to data store. The data will then be used for calculation. I don't wanna use SQL database as i thought the retrival process could slow down the performance. Hence, I am thinking of using either XML or Excel as data store for retrival and calculation. Is there anyone know where I can find more information about how to choose the approperiate data store. any help is appreciated. Thanks!! Carol You do NOT need to install Excel to be able to work with Excel files from the application. You could read and write Excel files using Jet OLEDB provider or some other tools and you do not need Excel application for it. Excel will work faster, since XML adds extr ...Show All
Smart Device Development Missing System.Data in CF 1.0 install on PPC 2002.
I've developed an application for CF 1.0 and am having difficulty running it on one of the two devices I have for testing. All is well on my PPC 2003 device, but I'm receiving an error on the PPC 2002 device. The error indicates I need a newer version of the framework and is unable to load a type from System.Data. Both machines have clean installs of the CF 1.0 SP3 redistributable. However, on the PPC 2002 device, the GAC_System.Data_v1_0_5000...DLL file is missing in the Windows directory. Instead, there's a system.data file installed into Program Files\.Net Compact Framework. That directory is empty on the PPC 2003 device. If I copy the System.Data file from the 2003 device into the 2002 device in the same directory, it doesn't wor ...Show All
SQL Server 'Log' is not a member of 'Microsoft.SqlServer.Dts.Tasks.ScriptTask.ScriptObjectModel'.
I have been developing a large SSIS project and it uses scripts extensively. During development, i encountered no problems. However, when i tried executing them on a server (windows server 2003), i was given this error for all the scripts: Here is a brief log: PackageStart,servername,network\login,PkgName,{A6778813-1F3A-4133-A00C-6F02AC8CC8B1},{EA6E6337-8C07-428D-9E3B-CEEB4F95A185},3/10/2006 5:24:26 PM,3/10/2006 5:24:26 PM,0,0x,Beginning of package execution. OnError,servername,network\login,PkgName,Rename Error Files,{8d38e1b7-44e8-419e-963e-c689edd0be2c},{EA6E6337-8C07-428D-9E3B-CEEB4F95A185},3/10/2006 5:24:30 PM,3/10/2006 5:24:30 PM,7,0x,Error 30456: 'Variables' is not a member of 'Microsoft.SqlServer.Dts.Tasks.ScriptTask ...Show All
Visual Studio Team System Error TF42028
We have recently deployed TFS and are having an issue with users seeing the existing build nodes in Team Explorer. It also causes it to throw the 42028 and 42025 error when the user attempts to run a build. (Using Domain Users and Groups to set permissions. Win 2003 Domain.) I have one user that has only been added to the 'Contributor" group of the project. This user can see the Build nodes and run builds without any issues. To make it work for the user in question and any subsequent users I create, I have to add them to the Team Foundation Server Administrator group. (adding them to the Project Admin had no affect) Once added to this group, all the nodes show up and builds run fine. Any suggestions would be appreciated. ...Show All
Visual Basic ADSI and Visual Basic .NET 2005
I have been trying for most of the day now to transform the following vbscript into visual basic .net 2005 with no luck whatsoever. The script adds an existing security group in active directory into a remote computer's Administrators group. vbscript Set oAdminGroup = GetObject("WinNT://ServerName/Administrators,group") oAdminGroup.Add "WinNT://Domain/SecurityGroup,group" Call oAdminGroup.SetInfo visual basic .net 2005 Dim oAdminGroup As New DirectoryEntry("WinNT://ServerName/Administrators") oAdminGroup.Children.Add(SecurityGroup, "group") oAdminGroup.CommitChanges() The following Error is what I receive: System.InvalidOperationException: The Active Directory object located at the path WinNT://ServerName/Admi ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Model animation
Hi, I'm working with XNA gamestudio for a while now, it's really great but there's no support for model animations I already searched the entire internet for some good tutorial or example but there isn't any. I just can't believe model animation isn't supported by standard Because...what is a game without animated models Also if anyone has some information about loading bones it would be welcome. I really hope that there's someone out here who can help me with this. I really enjoy using XNA gamestudio and I wan't to start writing games! Thanks for any help, jeroen The problem is that XNA offers a lot of easy tools for programming in c# to write games, but model animation seems to be barely supported, and that weird sin ...Show All
Visual C# The system cannot find the file specified
I have this problem: Could not load file or assembly 'Microsoft.SharePoint, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. HELP! Thank's! frederikm wrote: Hi the thing is that you are referencing an assembly, and loading a different one.. the thing i mostly do is copy the assembly you want to reference in a folder under your project and add the reference to the copy. are you loading the assembly from the GAC I did that! ...Show All
.NET Development TypeInitializationException + windows xp 64 ??
Hi, I have develped a C# application that runs well on windows xp SP2, but when I try to run it on windows xp 64 I get the 'TypeInitializationException' exception, the exception details is: System.TypeInitializationException was unhandled Message="The type initializer for 'StartWindow.ArabicTextMiningForm' threw an exception." Source="StartWindow" TypeName="StartWindow.ArabicTextMiningForm" StackTrace: at StartWindow.ArabicTextMiningForm..ctor() at StartWindow.Program.Main() in C:\GetDataBack_car\CAR\Soft_Associations_Charm_Apriori\StartWindow\Program.cs:line 17 at System.AppDomain.nExecuteAssembl ...Show All
.NET Development TableAdapters BaseClass
Hi, I have a problem with the TableAdapters implementation: let's say I want to implement a generic method that takes a TableAdapter and performs some operation on it. For the sake of example let's say I just want to open the connection the TableAdapter uses: public void PreOpenConnection(<TableAdapter base class > tableAdapter) { tableAdapter.Connection.Open(); } With the current implementation I would need to accept a Component parameter, and I wouldn't have a way to call any of the TableAdapter's methods, since I can't cast it to ...Show All
Smart Device Development Breakpoints do not get hit...
Hello, a colleague has big troubles debugging compact framework 2.0 applications from his VS2005 environment (to be more specific: he has hijacked my PC because the troubles do not occur there ). The problem is that every CF2.0 application he runs will not break when run on a device, but the same application runs and hits the breakpoints on the device emulator. It doesn't matter if it is a big multi-project solution or just a simple little HelloWorld project, the debugger just isn't interested in breakpoints anymore. We searched over this forum, but none of the solutions work for him. Some of the things we found and tried are: Deleting de bin/obj folders. Showing the Debug toolbar. ...Show All
Software Development for Windows Vista not able to create globally named objects
From MS' Windows Vista Soft. Logo doc.: Applications should not depend on globally named objects. Since, globally named objects can be created by any application or service, an application dependent on creating or maintaining such an object could fail. Additionally, a user running under User Access Protection will not be able to create a globally named object. In my app. I created global mutex for a shared resource. If this is not a "good" thing to do in windows Vista, what is the best practice MS recommend Also as of the Feb. CTP release of Windows Vista, the creation of my global mutex still working fine, so it's not like what it is described in the logo doc. Thanks in advance. ...Show All
.NET Development catcha sqlexception and column
I have an application in C#. I have a table that don't allow null values for a number of fields. I can do an update to the database and catch the SQLException produced if a required field is null (this works fine) What I want to do now is cath the exception, and know what column from the table is null. Can I do it Within the exception message you will see something similar to: Cannot insert the value NULL into column 'test', table 'test.dbo.Table1'; column does not allow nulls. INSERT fails. The statement has been terminated. You can then search this string for the column name Try Catch Ex As SqlException Dim str1() As String = Ex.Message.Split("''") Dim columnname As ...Show All
