CharlesB's Q&A profile
Windows Forms splitContainer problem/bug in .NET 2
Hello, I want to draw nice splitter in splitContainer. To do this, I call method below in splitContainer1_Paint event. private void splitContainer1_Paint( object sender, PaintEventArgs e) { ProfessionalColorTable pct = new ProfessionalColorTable (); Rectangle bounds = (sender as SplitContainer ).SplitterRectangle; // Make sure we need to do work if ((bounds.Width > 0) && (bounds.Height > 0)) { Graphics g = e.Graphics; // Setup colors from the provided renderer Color begin = pct.OverflowButtonGradientMiddle; Color end = pct.OverflowButtonGradientEnd; // Make sure we need to do work using ( Brush b = new LinearGradientBrush (bounds, begin, ...Show All
Windows Forms how to open instance of Ms Project
I want to open the instance of Ms Project or MS visio from my windows form and use its data or wana save this file in database and then i want generate report on the basis of this saved file or saved data plz tell me the way how can i implement this See this topic on MSDN: Getting Started: Developing with Project 2003 and this project: Excel Report from Microsoft Project ...Show All
.NET Development Comparing sql decimal to .net decimal
I pull decimals from a SQL 2000 database that have a scale of (14, 6). Let's say the value from SQL is 0, so it comes out 0.000000. I then do the following comparison: decimal x = 0; Convert.ToDecimal(column["column name"]) == x it comes back false. Why ! How can I compare a SQL decimal with a scale set to a local decimal 0 would not be equal to 0.0000 because you used == as your condition. == means that the two values you are comparing should be EXACTLY equal. It is better to convert both into the same format so that you can have accurate results in comparisons. you can add something like this inside your loop if (IsDecimal(column["name"]) == true) column[" ...Show All
Visual Studio Customize the ReportViewer ToolBar
Hi, Just wanted to know if we could customize the ReportViewer Toolbar. To give you a clearer idea i wanted to get rid of the unwanted file formats (for me) like the xml ,TIFF and Excel from the dropdown and remove the refresh button. Is it possible Regards Rajesh. You can remove various elements from the toolbar by setting the ReportViewer.ShowXXXX properties to false. The viewer does not provide the granularity to hide individual export formats, however. In server mode, you can hide individual formats by modifying the rsreportserver.config file. You can follow the examples that are in there for hiding renderers. Note, however, that this will hide the rendering extension for all instances ...Show All
Visual Studio Team System Schema Compare - Possible Bug
I am comparing a database to a project. One of the objects in my project has an error in it. When I do the compare, DBPro seems to treat the object in the project with the error as not there because the results of the compare show that it needs to be added to the project. Is this W.A.D Thanks - Amos. Alle, I don't understand the logic in this. Since DBPro treats objects that has errors as non-existing, when I do a schema compare the results will show the object needs to be added. However, when I go to apply the changes to my project, DBPro won't actually let me create the object because it already exists! This is like a catch-22. The only way around this that I know of is to physically delete the ob ...Show All
Visual C# How do I calculate amount of hours using DateTime
Hi all. As the title says... how do I calculate the amount of daily hours worked by an employee I'm pretty sure this is probably basic but I'm a novice and I'm trying to write a basic app to act as a weekly timesheet, either with VC# or ASP.Net I'm using DropDownLists to enable the user to select a starting hour and a finish hour. The calculation I'm using is (12 - startTime) + finishTime I'm sure I should be using the DateTime object but that's where I'm lost. Should I be using DateTime objects What values would I use for the DropDownList Value property Any help / advice would be greatly appreciated. Thank you. Jake Unfortunately the code above does not compile.... ...Show All
SQL Server TRANSACTIONS in SSIS (error: The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION."
I'm receiving the below error when trying to implement Execute SQL Task. "The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION." This error also happens on COMMIT as well and there is a preceding Execute SQL Task with BEGIN TRANSACTION tranname WITH MARK 'tran' I know I can change the transaction option property from "supported" to "required" however I want to mark the transaction. I was copying the way Import/Export Wizard does it however I'm unable to figure out why it works and why mine doesn't work. Anyone know of the reason If you are having three Execute SQL tasks like: BEGIN TRAN | | | V <Your SQL> | | | V END TRAN Then, you hav ...Show All
Visual Studio Express Editions Excel columns delete
hi, I want to delete some columns in Excel sheet. I am using the following syntax. all the columns are deleted but P3:P15 column not deleted. the P3:P15 values coming to L3:L15 place.and it is not deleted oSht.Range( "L3:L15" ).EntireColumn.Delete() oSht.Range( "O3:O15" ).EntireColumn.Delete() oSht.Range( "P3:P15" ).EntireColumn.Delete() oSht.Range( "N3:N15" ).EntireColumn.Delete() oSht.Range( "M3:M15" ).EntireColumn.Delete() what's wrong with this excel Any help Thanks It looks like when you are deleting a column, it shifts everything over to the left one column, so you might be deleting the same column over and over again. I would try setting up a loop to delete the current column 5 ...Show All
Visual Studio Express Editions How to read a text document in a ftp host???
Hello, I am un able to work out how i can read a file which is placed in my ftp server. I am trying to read a .txt file which is placed in my ftp server into a richTextBox and it does not like me using a internet source i have tryed using the.net and .web files but nothing seems to work. I am trying to read in the file like i normally would do TextReader tu = new StreamReader("ftp:////2908180212@freeftp.bravehost.com//web//pcclan.bravehost.com//UserCheck.txt"); does any one know what i am doing wrong or how else i can do this Thankyou in advance for your help! take a look at this: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=933461&SiteID=1 this will read the file via httpwebresponse. would this ...Show All
SQL Server datetime convertion in SqlServer 2000
SqlServer 2000 with SP3. RepTime is a datetime in TableA. I ran the two commands beblow: SELECT distinct CAST([RepTime] AS INT) FROM TableA 39004 39002 39003 select max(RepTime),min(RepTime) from TableA 2006-10-16 10:36:03.940 2006-10-13 17:32:00.080 From 2006-10-13 to 2006-10-16, there are four days. But I got three distinct int from it. Anyone knows Maybe you have two entries having the same date but different times DECLARE @test AS TABLE ( dat datetime ); INSERT into @test values ( '2006-12-19' ) INSERT into @test values ( '2006-12-20' ) INSERT into @test values ( GETDATE ()) -- This retrieves 3 columns SELECT DISTINCT dat FROM @test -- This retrieves 2 co ...Show All
Software Development for Windows Vista No show on samples
Ok, IE file version of 7.0.5450.4, .Net 3 CTP (as sandbox instructions), card selector no show on samples, fully able to login to Kim's site, can select and send card to sandbox, but site is "Unable to service my request". Why Luke Hi Luke Just used Reflector on my C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\System.IdentityModel.dll, seems it's Version=3.0.0.0. In you thread "Kim's site login" Garrett said "and it should be 4306.0 (or 4307.0). If it is lower than 4306, then you have the June CTP or earlier--get the newer one.". So maybe you need the newer one. Luke ...Show All
Visual Basic Is it possible to make a parent form a child form of another form vb.net?
Hi! I am new here as well as the programming language I am using. I am working with forms now and I just want to ask if it is possible to make a parent form a child form of another form What i want to do is something like this (grandparent ->parent -> child) When I set the parent as a child, it gives me the error that I can't set the parent as a child. Thanks in advance. You never indicated that you wanted MDI forms :) You can only have one MDI container. You cannot have MDI Containers as children of other MDI containers (which is what the error is telling you). However, you can have forms within forms, as I stated: so your MDI container is the 'grandparent', the MDI Children are actually pare ...Show All
.NET Development how does an xml file that contains 3 values look like pls?
I need an xml file with 3 values: field1 : value1 field2 : value 2 field 3: value 3 Can you help me with that Thanks what if i want two columns one called col1 and the other called col2 col1 will include id1 id2 and id3 and col2 will include item1 item2 and item3 llike a sql server table with 3 rows. Thank you ...Show All
Windows Forms Datagrid
Hi everyone, May i know how to read all the values in a datagrid one by one. I want to add all the values in each row in a particular column in the datagrid. Is it possible to do so A DataTable is an 'invisible' control that is part of ADO .NET 1.0 and above. Suggest you either get a book on ADO.NET or Visual Studio/Basic .NET 2002 or later....not VB6 or earlier or check the MSDN library if you have access to it. Infact of the data components are in the Data folder (not the Toolbox). Bye, ...Show All
.NET Development Computer not able to read app.config xml with encoding as 'ASCII'.Why?
Hi, What is the difference between encoding as 'ASCII' and encoding as 'UTF-8' We are creating App.Config.exe xml file with ASCII in the client place while they install our application. But some of the PC could not able to read this xml I will be very thankfull, if any one can provide me the cause for above issue For more background on the subject of XML encoding see http://msdn.microsoft.com/library/en-us/dnxml/html/xmlencodings.asp - Chris ...Show All
