CKa's Q&A profile
Visual C# Calculate TextBox values
I have three textBox's txt1 txt2 txt3....I want to know how would i go about calculating the value i enter in these textbox controls say if i enter 1 in txt1 and 3 in txt2 and 5 in txt3....then my txt4 texbox would say 9 since i am adding the values i enter in the three text control....any help on doing this thanks! pretty simple. you need to check if the values in the textbox's are of integer values otherwise you can't perform the calc. After determinating this, you need to convert them into integer type, do your calc and display the result. with .NET 2.0 there is TryParse which sees if it can parse the values to a type but since you are running .NET 1.0/1.1 apperently its a bit more work. private void DoCa ...Show All
Game Technologies: DirectX, XNA, XACT, etc. 1.) Lock/Unlock vs. SetData/GetData and 2.) predefined vertex formats
Two points spring currently to my mind. Is there any reason besides simplicity not to use the common Lock/Unlock mechanics I would prefer the addition of this to the API. GetData/SetData canthe simply be mapped onto this. I have a large terrain, that I tesselate into the locked buffer directly... With this new scheme I have to build a temporary array and then copy over via SetData, same with textures. On the other hand, if we have to live with this, why do we have the managed pool anymore, kind of pointless! The other thing are the predefined vertex formats... Any reason to not expose the members directly and use setters and getters instead I don't see the point here too, this just forces us to create one intermediate result and copy oper ...Show All
Architecture Approach for modeling a class to import/export information
In my web app (C#), we need to import/export an infinity of txt, xls and xml files. I would appreciate opinions or experiences on how would be an elegant (though easy way) to implement a class/componentto deal with this. BTW, the mechanism will be always the same, that is, import some information from a file (xml, txt or xls) and save it to the database (we are using an ORM), or read some information in DB and export it to a file (xml, txt or xls). What about requirements Are there requirements for the format of the files What database is being used Does it need to support multiple database types Do you always import / export the same datamodel or can the user choose what tables / data to import / export P. ...Show All
Visual C# Formating text in a datagridview
How do i convert the text of a cell in the datagridview to uppercase before i save it to the database are you using a DataAdapter to update the database Generally you would simply get and set the value of the cell and use the ToUpperCase() in the string class to make the text/string uppercase, however this is untested: this.theDataGridView.Rows[ RowIndex ].Cells [CellIndex] .Value = this.theDataGridView.Rows[ RowIndex ].Cells[ CellIndex ].Value.ToString().ToUpperCase(); does this work ...Show All
Windows Forms Multiple Columns on a Listbox from a Bound Source
Hi. This is probably a typical noob question, but i cannot seem to find an answer. I am using Visual Studio 2005 Professional. I have dragged a list box control onto my screen and bound it to a database table showing a list of names. I can select a value and pass it to another screen quite happily. However, I would like to show several other columns (3 at least) for information only. The current column holds the data I need to pass, I just need to show these other columns to allow at a glance review of status. eg. <Name> <Val> <Val> <Text> so that the name is passed using .SelectedItem.ToString I am using the visual designer, but dont see amything in properti ...Show All
SQL Server SQL server 2005 Mirroring
I am trying to set up a SQL mirroring senario - I have some questions Do I need to purchase an extra SQL Server license for the SQL server instance on the Mirror what about the Witness does that also need a separate license/ Can the witness be a virtual server on the Mirror box itself Do I still require a license if the witness is on a virtual server Thanks jawahar I think Mirror - you do need another license Witness - you could run it off any other SQL server, or use the FREE SQL Server 2005 Express regardless of VM or not If you need OS for VM, Windows 2003 Enterprise allows up to 4 VM licenses (ie. 1 host + 4 VM) ...Show All
SQL Server SUM a column of values derived from an IIF expression
I have a table in my report which shows sales values for each month by looking at the month number so for Jan i use =IIf(Fields!period_.Value=1,Fields!nett_.Value,0) for Feb =IIf(Fields!period_.Value=2,Fields!nett_.Value,0) this is all good and I get a series of rows per customer with the correct value in the correct column JAN FEB Mar Customer A 250 Customer A 350 Customer A 5000 . However I want to create a summary a line JAN FEB Mar Customer A 250 350 5000 I tried using SUM but this doesn't give all of the values in the summary line. It might just give the first and the rest are zeros. Or if the customer didn't have a ...Show All
Visual Studio Team System How to add multiple workitems with <TFPT workitem> using the option @filename
I am looking for a solution to migrate multiple work items from one project located on TFS "A" to another project located on TFS "B" - perhaps by using the TFPT workitem command. Creating a list of items e.g. as XML from a query or as text output of the command <TFPT workitem @> works quite fine. Afterwards I'd like to use this list in order to create the new items (with the same field values) on the other server's project. Three main questions come up: How should the file look like which gets piped in the command TFPT workitem /fields:@filename How to disable work item validation for field values (e.g. I'd like to keep the current state and other fields as well) while creating the new items D ...Show All
Windows Forms Can I store a bitmap file in a globally accessable file, instead of a form's imagelist?
Hello, I am aware of the methods for storing images in an imagelist that resides on a form. But sometimes my tree node does not have the form's pointer. I would like to store some of my bitmaps in a globally accessable singleton object. Has anyone done this Thanks for the help! Bob The underlying Windows TreeView common control only supports tree node images via the TreeView's ImageList. You don't need a reference to the Form in order to load a bitmap into a tree node. myTreeView.ImageList = new ImageList(); myTreeView.ImageList.Add(Image.FromFile(@"C:\directory\subdirectory\filename.ext"); TreeNode node = new TreeNode("My Node"); node.ImageIndex = 0; myTreeView.Nodes ...Show All
Visual C# Schedule Event
Hi again... I need to run this every day at the same time or once a week on a predefined day and hour. How's it done Been through allot of research but couldn't make it work This is the event i need to schedule private void BackUp() { Cursor = Cursors .WaitCursor; SQLDMO. _SQLServer srv = new SQLDMO. SQLServerClass (); srv.Connect(server, username, password); SQLDMO. Backup bak = new SQLDMO. BackupClass (); bak.Devices = bak.Files; bak.Files = BackupFolder + database + ".bak" ; bak.Database = database; bak.SQLBackup(srv); this .Cursor = Cursors .Default; } catch ( Exception err) { this .Cursor = Cursors .Default; MessageBox .Show(err.Message, &quo ...Show All
SQL Server sql 2005 cluster
we want to have an active\passive and active passive cluster. node a install sql instance 1 failover over to node b node b install sql instance 2 failover to node a do I have to setup 2 cluster ie. quorum, msdtc etc.. or just one cluster(quorum, ip and name), one msdtc group( as per MS msdtc doc) and 2 san disks (one for node a and one for node b. is this correct I have looked and looked for a step by step on setting this up, no where can I find what i need. I downloaded the failover cluster doc from microsoft, book online etc.. thanks so I run the install on both nodes in failover Install on node 1 everything fine run setup on node 2 I tried that and was receiving thi ...Show All
Visual C# StructLayout, Marshalling
I send and receive packetized data over a serial port connection. The data is strictly defined, so the memory layout of the interface defintion has to be implemeted in C#. The type of packets I am sending/receiving look something like this: // Temperature Packet Id=5 int PacketId; int PacketLen; int32 CurrentTemp; int16 CurrentPressure; Bool IsHeaterOn; Bool IsHeaterEnabled; byte LastErrorLimit; // UserPacket Packet Id=12 int PacketId; int PacketLen; char [64] CurrentUserName; int32 LastLoginTime; So I will be setting/reading bits, bytes, words and strings in multiple packets. I have discovered the StructLayout attribute and think this could be the best way to implement this ( ! ). I am using C# and want to use manage ...Show All
Visual C# Object reference not set to an instance of an object.
Hi, I have this Code (I use .NET FrameWork 2 with Enterprise Library for Data Access and Logging) : try { DbCommand SpCommand = DB.GetStoredProcCommand( "CreateUser" ); DB.AddInParameter(SpCommand, "name" , DbType .String,name); DB.AddInParameter(SpCommand, "city" , DbType .String,city); DB.AddInParameter(SpCommand, "description" , DbType .String,description); result = ( int )DB.ExecuteScalar(SpCommand); } catch ( Exception ex) { Logger .Write(ex); throw ex; } I Get This Error : Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Source Error: Line 54: { Line 55: Lo ...Show All
Software Development for Windows Vista win svc/wcf workflow works fine w/debugger attached but...
when I do not have the vs2005 debugger attached I get workflow exceptions in random places. I thought it might be some kind of race condition (any articles on race conditions would be appreciated) and put in delays in my custom NoOp activity, but that did not help. I sent debug statements to listener text file but it doesn't show why the workflow is throwing an exception. Since the workflow runs fine in the debugger I'm kind of at a loss as to how to troubleshoot. Any help appreciated. Tom - Thanks for your reply. I found the issue after correcting the WorkFlowRunTime.ServicesExceptionNotHandled delegate and finally getting debugs to a text file. The problem was my custom tracking servi ...Show All
Community Chat Making .Net application for Touch Screen
Hi all, I've to make such application (in .net) which is to be use on LCD touch screen. Actually I am on the Project of Hospital Management System. So, for that we ve to install such machine which'll provide information to Patients, Doctors, as well as Visitors. So my question is that "Is it possible to built such application (In ASP.Net), which can be easily used on LCD touch Screen If yes then how Thanks in advance to all Regards vinobaje wrote: i want to make a touch screen application any body can help me pleaseeeeee how to make the touch screen application which languege can use please help me you can use any .Net language, there's no limitation as far as I'm aware. you ...Show All
