Magius's Q&A profile
Windows Forms How to enlarge the size of the DataGridView's "Edit Columns" Dialog
I am developing a custom DataGridViewColumn type and a derived DataGridView control. I always think the size of the DataGridView's "Edit Columns" Dialog is too small. My question is this: Is there a way to enlarge this dialog. Thanks, Yamakei if u want to build an automatically size columns in a DataGrid , here is an example One way to do this is to use MeasureString to compute the size of the text in each cell, and then take the maximum value. Below is a code snippet that does this. It assumes your datagrid is bound to a datatable. You can download a full working sample. ( C# , VB ). public void AutoSizeCol( int col ) { float width = 0; int numRows = ( (DataT ...Show All
Windows Forms Custom Action runs from version being replaced
I have a VS2003.NET deployment project with a custom action written as a VB DLL. It works fine when I install on a clean machine, but fails when I install over a previous version. I've tracked the problem down to the custom action execution. When installed over a previous version the new DLL is installed onto the machine before the custom action is executed (as expected). However, the install action that executes is from the old DLL. It appears the assembly is being loaded by MSIEXEC during the uninstall phase, and the new assembly is not loaded during the install phase. Thus the logic from the old DLL runs. I've ensured that the version of the new assembly is newer than the old one. This has no effect. The RemovePreviousVersions ...Show All
SQL Server New to SSIS, seem to me missing something fundamental:
I am attempting to import data into SQL 2005 (using the Tasks->Import Data wizard) and get as far as selecting a datasource. My source is ODBC and I am selecting ".NET Framework Data Provider for Odbc" but then get stuck on the connection string... I am attempting to import from 'Relativity Client' which as far as I can tell is an interface to a Cobol database, I have also had this problem importing from FoxPro - how do I come up with a connection string I have also tried to create a DTSX package, created the connection to the odbc source, tested ok, then when selecting the connection as a source (datareader source) I get the message 'Cannot acquire a managed connection from the run-time connection manager'... I have als ...Show All
Windows Forms DateTimePicker Year not available for validating
I have a DateTimePicker with a default value of today's date. When the user enters the date as "01/10/00", the value available in the validation event is "01/10/2006" instead of "01/10/2000". Does anyone have a way of solving this problem I thought of a better, but riskier workaround: fool the control into believing it lost the focus when the Validating event runs. Add a new class to your project and paste this code: using System; using System.Windows.Forms; using System.Runtime.InteropServices; public class FixedDateTimePicker : DateTimePicker { [DllImport("user32.dll")] private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wp, IntPtr lp); private ...Show All
Windows Forms How can I protect my source code?
How can I prevent code decompilation when I publish or when in the designer so that no one can decompile it, change it, and sell it as their own Thanks, theres a free tool in vs2005 called Dotfuscator, or you can download it from http://www.preemptive.com/products/dotfuscator/ i really wouldnt know how to use it but thats what you need to do. ...Show All
Visual Studio Team System CTP 7 on Team Suite, Schema Import - "statements were not fully understood"
There are numerous statements like this: ALTER TABLE [dbo].[DCJStatTx] NOCHECK CONSTRAINT [FK_DCJStatTx_DepartmentDeptSchedule] GO ALTER TABLE [dbo].[DCJStatTx] NOCHECK CONSTRAINT [FK_DCJStatTx_EmployeeEmployee] GO ALTER TABLE [dbo].[DCJStatTx] NOCHECK CONSTRAINT [FK_DCJStatTx_JobOpenJob] GO ALTER TABLE [dbo].[DCJStatTx] NOCHECK CONSTRAINT [FK_DCJStatTx_JobStatusStatusCode] GO ALTER TABLE [dbo].[CustInvNotes] NOCHECK CONSTRAINT [FK_CustInvNotes_Division_AcctDivisions] GO ALTER TABLE [dbo].[CustInvNotes] NOCHECK CONSTRAINT [FK_CustInvNotes_CustomerNCustomer] GO ALTER TABLE [dbo].[QQOrderDet] NOCHECK CONSTRAINT [FK_QQOrderDet_ProductID_QQProducts] GO ALTER TABLE [dbo].[QQOrderDet] NOCHECK CONSTRAINT [FK_QQOrderDet_SizeIDQQSize] GO .... ...Show All
SQL Server Does Replication Use Compression?
Does SQL Server replication impliment any kind of compression It seems to me that this would be very helpful for congested WAN links and costly merge replication. Compression seems like it should be a given, I hope MS decides to add this. For our situation, we have large amounts of data changes and while the connections are reliable, they may not always be ultra fast. The doc quoted states that it can make use of the compression provided by the protocol, does that mean you could you use gzip ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Are these videos still usefull?
http://www.microsoft.com/events/series/msdnvideodev.mspx Are those videos still usefull for using XNA (the basics) and will there be similar XNA videos released Thank you for your time. Yeah Im pumped. I remember filling out a survey from Gamedev about MS and asking about what I knew about tourqe, since then I guessed MS was doing something like it. Will be exciting! ...Show All
Visual Studio 2008 (Pre-release) Bubbling a Dependency Property
I've added a property named HighlightColor to a custom class: public static DependencyProperty HighlightColorProperty = DependencyProperty .Register( "HighlightColor" , typeof ( Brush ), typeof ( LogoBase ), new FrameworkPropertyMetadata ( new SolidColorBrush ( Color .FromArgb(255,250,175,62)), FrameworkPropertyMetadataOptions .AffectsRender)); public Brush HighlightColor { set { SetValue(HighlightColorProperty, value ); } get { return ( Brush )GetValue(HighlightColorProperty); } } I'd like to add the same property to the class's parent and have the class use the parent's value unless I specify it in the XAML--just like FontSize does. Is this related to the Register() method How does this wor ...Show All
Visual C++ Is it possible to consume a VB.Net .dll from C (unmanaged not c++)
I have a VB.Net dll that contains functionality I need to access from a C program. As GetProcAddress won't get me where I need to go (right ) and I cannot create an instance of anything (C not C++) is there a route possible to loading this library Well, on to the next tall brick wall. I need the ability to retain a .Net class object between calls from the C .dll. If I try to create a global vaiable in a file compiled with /clr I get the compile error 3145. I don't see how I can add a vaiable to the class as the #using directive is in the .cpp file so the header knows nothing of the variable I am declaring... Besides, the header needs to be included in the file that exports the functions. So basically wha ...Show All
SQL Server Distributed Transactions. It doesn't RollBack
Hello everyone, I'm using MSDTC on a package, it transforms data from an excel file to a SQL SERVER 2005 DB on a Foreach Container. Sometimes there might ocurr some transformation problems like data overflow or invalid caracters. Well i'm aware of this so i would like to perform a Rollback Operation in order to avoid the recording data on the db. But it doesn't, even though i'm using this transaction. The worst part comes when recording on a master table (master transformation task) and a detail task stops the package, So no record rolls back. Is there any consideration i'm not taking care of By the way, every task is using Transaction = Supported except of the Foreach Container so the It can read excel files independently of the others e ...Show All
Visual Studio 2008 (Pre-release) Create ellipse where myEllipse.Opacity=.40 & Stroke.Opacity=1
I want to create an ellipse in c# where the Fill.Opacity is less than 1 but the Stroke.Opacity of the ellipse is still 1. Also, I simply tried setting the ellipse opacity to .40 and the stroke to Black and I expected to get a gray border but it doesn’t show at all. What are the ways I can create a border around the ellipse where the fill has an opacity less than 1 Here’s me code: void DrawEllipse() { Ellipse myElippse = new Ellipse(); myElippse.Height = 10; myElippse.Width = 10; myElippse.Fill = Brushes.MediumBlue; myElippse.Opacity = .4; myElippse.Stroke = Brushes.Black; myElippse.StrokeThickness = 1; //myElippse.Stroke.Opacity = 1; //No can do: myElippse.Stroke is ReadOnly. Canvas.SetLeft(myElippse, 15); ...Show All
Visual C++ DLL without CRT
Is it possible to create a dll without it's copy of the CRT, so that it would use one from the context of the calling process well, the thing is that i am creating projects with CRT statically linked, and i DO want to create a dll without it's own copy of the CTR. that was my question. I already had problems with freeing the memory i have allocated in a dll. I have solved them by rewriting an allocator for vector and map.But now i am thinking of this another possibility. As long as the dll's code is executed in the context of calling thread, i thought it could be possible to use the caller's copy of the CRT.. ...Show All
SQL Server SQL Server 2005 queries not using correct indexes
Hi, I'm running into issues where SQL Server 2005 SP1 queries are not using the best indexes. A query with nested subqueries runs in 1 second and performs about 400 logical reads on TblA in the DEV environment (dual proc server). The same query takes 8 seconds and performs 180423 reads on TblA on the production server (quad proc server...basically a lot better in terms of hardware). The 2 databases have the same schema and same data. I've updated stats w/full scan on this table in PROD and issued a sp_recompile TblA. No change. If I provide an index hint on PROD, then the query runs the same way it does on DEV (413 logical reads and runs in under 1 second). Is there any way (other than by using index hints) to resolve this iss ...Show All
Visual C# Adding a item to a IDictionary<String, List<String>> object
Hello! I know this must have an stupidly easy solution, but now I just can't find it :( I have this collection: IDictionary<String, List<String>> publishers = new Dictionary<String, List<String>>(); The keys will be some web publishers names, such as "wired.com", "internet.com", etc. The values associated with these keys will be lists of urls (I'll be reading the urls from a txt file). The code: StreamReader sr = File.OpenText("blah.txt"); //initialize the dictionary structure for (int j = 1; j <= numberOfPublishers; j++) { this.publishers.Add(publisherName, new List<String>()); } string url = sr.ReadLine(); do { if (Regex ...Show All
