Khenat.Ram's Q&A profile
Windows Forms Data Not Saving In Calculated Field
I have a textbox that is populated from a calculated variable. The textbox populates ok but when I save the data, the textbox resets to zero and saves to the database as zero. All of the other data on the form saves appropriately. The data is originally binded as: ctl.DataBindings.Add(new Binding("Text", usmDataSet_est1.Tables["cabinet"], ctl.Name, true, DataSourceUpdateMode.OnPropertyChanged)); I'm setting the text property of the calculated value with: private void populateAreaTextBox(string First, string Last, Control ctl) { string sArea = Convert.ToString(Decimal.Round(calcArea(), 2)); ctl.Text = sArea; } What could be the problem The textbox is read-only. I'm using VS200 ...Show All
Visual Studio 2008 (Pre-release) How can i create a treeview nodes dynamically ?
Hi, is there anyway to create treeview's nodes and its level dynamically i have actually a variable number of levels for treeview childs and i can not figure out how could i use HierarchicalDataTemplate to create variable number of levels. thats y i would have to create nodes programatically and its template. is there any better way to do that thanks If you bind the TreeView to your data source, you could set the HierarchicalDataTemplate's ItemTemplateSelector property to a class which dynamically builds the multi-level HDT according to the types of the objects being displayed. Using the item template selector is explained by Beatriz Costa her "How can I do custom Grouping" post: http://www.beacosta.com/ ...Show All
SQL Server past and future date
How should I find the dates for 3 days past and 5 days future. Such as TodayDate-3 and TodayDate+5 base in the date only, discarding the time Adamus Turner@discussions.microsoft.com wrote: > [quote user="NNTP User"] > > This is likely to be a bit more efficient, since it doesn't > require converting from datetime to varchar: > > > SELECT > dateadd(day,datediff(day,0,getdate())-3,0) AS [3 Days Ago], > dateadd(day,datediff(day,0,getdate())+5,0) AS [5 Days from now] > > Steve Kass > Drew University > www.stevekass.com > > JIM.H.@discussions.microsoft.com wrote: > > >>How should I find the dates for 3 days past and 5 days future. Such as >>TodayDate-3 and TodayDate+5 base in the date only, discarding the ...Show All
Visual Basic FileUpload - How do I trap maxfilesize problems
The fileupload control works well for files < 4MB (maxrequestlength), but if the file is larger than this the program fails with: - the page cannot be displayed, or Server error in '/xxxxx' application Maximum request length exceeded How do I trap this so that I can return a better error message The failure occurs before the Page Load from any callback, so I can't see any way of trapping the error, and I haven't seen any event or property of the Fileupload control that I can set to say "Do this when Max Request Length is exceeded" I don't want to accept larger files, I'm happy to live with the limit. Regards, Robert Barnes Well actually it isn't that easy. ...Show All
Windows Forms Publish App using Deployment Manager
I Publish the App using Deployment Manager.Other users install it using the location link. Next if i publish a new version then the other users have to restart twice to get the update of the new version. Can anyone help me out ...Show All
Visual Studio Error on a Help File Build
Hello, I received the following error when building a help file on a project: Error: Unresolved assembly reference: System.Windows.Forms (System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac) required by apiregedit The project is building fine and I don't see any broken references. Thanks in advance for your help :) Bob Hanson hi, I am really new bee for sandcastle and I have exactly same problem, can anyone of you explain this in more detail thanks in advance :) regards, rashmi ...Show All
Visual C# Multidimensional Arrays
Ok, my book really sucks I think. After struggling with an example in the book, I looked in the MSDN and searched these forums. I believe my book is wrong when it shows: int[,] student = new in[4][3]; I tried doing it that way but it errors. int[,] student = new int[5,4]; gives me no error and works. I am going to go with that. Unless someone can tell me that int[,] student = new in[4][3]; is indeed a correct format or what kind of a typing error it could be... The following also seems to be in the wrong format: int[][] x = { { 2, 3 }, { 4, 5 }, { 6, 7 } }; I don't think you can do it that way... Foolios wrote: int [][] x = { new int [] { 2 , 3 , 4 }, new int [] { 5 , 6 , 7 , 8 ...Show All
Visual Studio Express Editions Delegate issues
Im using .net version 3 and having a issue with the delegate call. A second thread is tring to append text onto one of the windows but keep gettings cross thread errors. Anyone able to tell me why the first WriteMessage fails and the second does not. I would prefer not to have to send a ref everything I need to do a call. Example code as follows // Code from different thread and file ChannelWindow cw = new ChannelWindow(); cw.WriteMessage(message); cw.WriteMessage(ref cw, message); // Channel window file public delegate void myMethodDelegate(String message); class ChannelWindow { // This fails causing an exception with message "The calling thread cannot access this object because a different thread owns it.".   ...Show All
Visual C++ Binary
I am using VS 2005 standard edition. I am sending and receiving data via RS232 using an application that I written in C++. The data is ascii but I want to see a binary representation in order to analyse it completely. I am reading the data received into a text box. Is there a standard method of converting the ascii data in the text box into its binary representation Oh - this is C++/CLI. CString is part of MFC. However, the .NET framework does it better anyhow String ^ myString = Convert::ToString(Convert.ToInt16(txBx1->Text), 2) should do it. You need to pass your number as an int, and then ToString(str,xx) will convert the number to a base xx string. ...Show All
Visual C# Code generation for property 'cursor' failed error in VS?
Hi, I'm getting the following error in VS2005 pro on xp sp2; 'Code generation for property 'Cursor' failed. Error was 'CursorConverter' is unable to convert 'System.Windows.Forms.Cursor' to 'System.ComponentModel.Design.Serialization.InstanceDescriptor'.' Anyone know what this is about Hi Anson Horton MSFT You are right, when we have multiple versions of same then we can have such error.... I am also facing the same problem but . . .. After facing such problem (in vb.net) I have created Project from scrach. . . . say, myUserControl Then i have started new instance of VS 2k5 and created new project ...say, TestMyUserControl , and i am refrencing MyUserControl in this project... but still I am facing same ...Show All
SQL Server Transactional replication: commands are not applying to subscriber
Hi! The distributor was down for a long time (neer the week) and after that the commands stop applying to subscriber, while they successfully collected from publisher and stored into distributor. Replication agent on distributor reports that initial snapshot is not available. It seems subscription is expired. But all commands from the point distributor down I have. How can I make distr agent to resume activity without reinitialize snapshot You right, it expires. I try to update status field in mssubscriptions table to value 2, but an agent anyway cannot apply commands. It seems distribution clean up job removed many commands and that is why distr agent cannot apply them. I think distribution clea ...Show All
Visual Studio Express Editions fatal error RC1021: invalid preprocessor command 'import'
I'm importing the msxml library like this: #import "msxml3.dll" If I do this in cpp files everything is fine. I can compile and link no problem. But I have a header file (qdbclient.h) that defines a class where some of the members of the class are XMLDOMDcouments. So I find that I need to do the #import "msxml3.dll" in the header file as well to get things to compile. After putting the #import "msxml3.dll" in the header file, when I compile I always get: Compiling resources... .\qdbclient.h(1) : fatal error RC1021: invalid preprocessor command 'import' I can get this error message by right clicking on the one resource file in the project and clicking compile. If I individually compile any of ...Show All
SQL Server Direct vs. Indirect Package Configurations
If your XML configuration files will be in the same location on your Development, UAT and PROD servers, is there any merit to making your configurations indirect I am modifying the connection string with the XML. My strategy is to set up an XML configuration for each database that we have. The Dev XML config will point to Development connection, UAT to UAT etc.. My thought is that by using the direct configuration it will eliminate the need for environment variables and also allow me to add configs without having to reboot the servers, which you would need to do in order to get server to recongize the EV. Thanks Dear Kirk, I got your book, and downloaded the samples. For the Config utility ...Show All
Visual Studio Tools for Office Remove borders from Excel charts using C#
I am building an excel file from scratch. this includes charts of data. In this particular case I need to remove the borders from the chart, but it doesn't appear to work correctly. // The next three lines are an attempt to remove the border, the fourth shows that I am controlling the chart ((Excel.ChartObject)oSheet.ChartObjects("Chart 1")).Border.LineStyle = Excel.XlLineStyle.xlLineStyleNone; ((Excel.ChartObject)oSheet.ChartObjects("Chart 1")).Interior.ColorIndex = 2; ((Excel.ChartObject)oSheet.ChartObjects("Chart 1")).Border.ColorIndex = 2; // After attempting above I use the following code which works to round the corners ((Excel.ChartObject)oSheet.ChartObjects("Chart 1")).RoundedCorners = true; I don't want to round the co ...Show All
Visual Studio Express Editions MDI Child Once Only please
Good Afternoon All, or morning or whatever, I'm sure one or two of you have come accros this and the answer is probably staring me right in the face, but how do I get the child forms to be shown once, for example.... .... I have my MDI Form, a menu etc under one of my menu items "&Help" I have, "&About", "&Support" and "&Licence" now I only what each of these forms to be shown once. I have tried: about f = new about(); f.MdiParent = this; f.ShowDialog(); but this just throughts an exception (cant remember of the top of my head) some thing like this form can not be displayed in this manor. When I get home I'll make a note of the error and post it here (if I rem ...Show All
