698 Posted Topics
Re: have you tried the openFileDialog? It has the same view as the explorer window, with a dropdown to select views such as details/large icons etc. | |
Re: The problem is the way you are handling the atomic number...it crashes because when you add an item it has its atomic number saved incorrectly: [CODE] if (m_theTable.ElementHasData(atomicNum - 1)) m_theTable.getElement(atomicNum).Print(); [/CODE] you are checking to see if 'atomicNum - 1' has data..then trying to print 'atomicNum'. A quick fix … | |
Hi, this is giving me a major headache and my boss wants the project wrapped up asap : / I have two views pulling data from several tables. The end result is this: CustomerTotals CustomerID numeric(18,0), ProductID numeric(18,0), Delivered numeric(5,0), Ordered numeric(5,0) SupplierTotals SupplierID numeric(18,0), ProductID numeric(18,0), Delivered numeric(5,0), Ordered … | |
Re: Rather than trying to iterate through the datagrid's rows, use the underlying datasource: [CODE] foreach (DataRow dr in ((DataTable)dataGrid1.DataSource).Rows) { if ((bool)dr[0]) { strFName = dr[1].ToString(); strLName = dr[2].ToString(); } } [/CODE] | |
Re: It depends a great deal on the way the mobile's OS works, what access it grants to the camera etc. Considering the time frame youhave and what's riding on it, i'd steer clear of something that could hit a major issue and fall apart. Also, what if the camera is … | |
Re: [QUOTE=sknake;1041458]What are the values of the statement when you get the stack overflow message? Is this a recursion issue? Post the code for your entire class.[/QUOTE] The logic looks sound to me, how deep is the tree that you are checking? As sknake said, it looks likely to be a … | |
Re: if you are using the DataGridView control then adatapost's code will work for you. However, you refered to a DataGrid; does this mean you are using the older DataGrid control or (like so many) did you drop the 'View'? :p If you are using a DataGrid then there is no … | |
Re: [QUOTE=tgsoon2002;1046086]I have know programming for 5 years. but not get any process yet. I want to ask what you do when you get a project and meet some problem? normally we must get the idea, pseudocode, get the flow of program. now i get the flow of program, idea. but … | |
Re: [QUOTE=avirag;1046101] and remember one thing u cant write the console code in visual studio, it wont work here..........QUOTE] It will if you select "Console Application" from the New Project screen :) try [URL="http://msdn.microsoft.com/en-us/library/ms438026.aspx"]this[/URL]. | |
Re: ddanbe is refering to his reply in your other thread:[URL="http://www.daniweb.com/forums/post1044218.html#post1044218"]here[/URL]. Since you are posting them as seperate issues and ddanbe and diamonddrake have given you the code to read in the contents of the file i wont go over that. To split the string you can do something like: [CODE] … | |
Re: a quick google search brought me to [URL="http://www.irritatedvowel.com/Programming/Standards.aspx"]this[/URL] and [URL="http://msdn.microsoft.com/en-us/library/xzf533w0(VS.71).aspx"]this[/URL]. Naming conventions are entirely down to personal preference, but by adhering to recognised standards, it makes your code easier for others to read and follow :) | |
Re: The qustion seems a little ambiguous, i would check a few points with your lecturer. Primarily, 'Function' is a very ambiguous term: - in plain English it means a role or purpose for an object. - in a proceedural coding paradigm a 'Function' is a named code block which returns … | |
Re: An excellent explaination DdoubleD :) And a great attitude from CyberPirate1. So many people paste the code, see that it works and move on. Its great to see someone stop to say "great, it works...but why does it work?". That attitude will serve you well as a coder :) Oh, … | |
Re: You have started on the right track. Just break down the question. Often it helps to map out the required operations in pseudocode. Just focus on what you need to read in, process and output at this stage, then worry about the syntax afterwards. Your question already tells you everything … | |
Re: One of the key benefits of type casting is that you know how the compiler will treat your variables. In the classic example: [CODE] var x = 5 var y = "37" var z = x + y [/CODE] Some compilers would treat both variables as strings and concatenate them … | |
Re: You can check out [URL="http://msdn.microsoft.com/en-us/library/e2c9s1d7(VS.80).aspx"]this article[/URL] over at msdn. It outlines adding embedded resources to a project. Embedded resources are stored in a resource file rather than in their native format on the harddrive. They cannot be editted so this is only suitable for non-changing resources. Never used it myself … | |
Re: Just a thought, but wouldnt it be better to have a seperate table for the additional fields in a zero-to-many relationship? Something like: TABLE OF ITEMS ItemID numeric, ItemDesc nvarchar(max) TABLE OF ATTRIBUTES AttributeID numeric, ItemID numeric, AttributeName nvarchar(max), AttributeType nvarchar(50), AttributeValue nvarchar(max) ItemID and AttributeID as seeded identity keys, … | |
Re: [QUOTE=crazyboy;1042641]no i m not passing any illegal character ... and now its solved ...[/QUOTE] i dont think sknake was suggesting you were deliberately using illegal characters, what he asked you to do is a standard step in debugging an error like this; if a variable is throwing an exception, check … | |
Re: [QUOTE=adatapost;1042450]Add a handler for [b]KeyPress[/b] event by double clicking on event name [b]KeyPress[/b] at Properties windows and put the code inside the keypress handler suggested by Mr. DdoubleD.[/QUOTE] Almost word for word what i was about to type :p If you are new to C# then this is a concept … | |
Re: Your Application.Run should run your parent form. [iCODE]Application.Run(new Form1());[/iCODE] in your Form1 FormLoad event you create and show the login form. By showing it in the form load it will appear before the parent: [CODE] private void Form1_Load(object sender, EventArgs e) { FormLogin login = new FormLogin(); login.MdiParent = this; … | |
Re: what did you change other than variable names? One thing to watch out for with excel; if you have different data formats in a column it can cause problems. When reading in the data the majority datatype in each column is used. For example, if the first few rows of … | |
Re: You could also look into [URL="http://msdn.microsoft.com/en-us/library/aa730869(VS.80).aspx"]settings[/URL] to store application data. | |
Re: What values do you need to pass? Unless you right a custom event handler, the click event has a defined argument list. You can check which button was clicked inside the event handler by converting Sender back to a button: [CODE] Button btnClicked = (Button)sender; if(btnClicked.Name=="Button1") //do something [/CODE] Alternaively, … | |
Re: [QUOTE=nick30266;1037616]can somebody help me with this program?? i have to program a matrix with n column and n row and it should be able to find a path moving like a horse in chess game(L) that touch every point of the matrix once. the program consist in enter the location … | |
Re: [QUOTE=Mitja Bonca;1038974]This is the same like I did in my 1st upper example. Correct is: [CODE]FileStream fs = new FileStream(System.IO.Path.GetTempPath() + @"\MyTempDir\" + "\\" + listBox1.SelectedValue, FileMode.Create);[/CODE] [/QUOTE] The code adatapost gave you wasn't the same as your original, or did you mean it gave the same result? You need … | |
Re: Hi, I had a similar issue on a project. I overcame it by handling the datagridview's CellValidating and CellValidated events. This event fires whenever a cell loses input focus, enabling content validation. You can use the validating event to check the data entered then update the data source in the … | |
Re: [QUOTE=sknake;1038755][B]>>we are loading the db data and xml into datatables[/B] Just load them both in memory on your machine and compare them. [/QUOTE] Did i mis-read this or is there some ambiguity in the term 'datatable'? I took it to mean a datatable object in memory :p If they mean … | |
Re: Firstly, please use CODE tags when posting code, there is a sticky from Dani at the top of the forum pages with details on their use. Secondly, try changing your code to this: [CODE] public class ClientLibrary { private bool connectionStatus; private Socket oClientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); private … | |
Re: Double clicking on a control will create the default event handler. To create handles for other events, got to the properties panel and change to the Events section (lightning bolt at top). Then double click on the area next to the required event and a basic event handler will be … | |
Re: [QUOTE=CSG-SQU;1037702]i already didi !! the problem is the same !![/QUOTE] Without seeing all of your code its hard to give a defintie aswer, but is the line [iCODE]mobileStore.Add(m1);[/iCODE] inside a method or is it at the class level? You may be missing a closing bracket or have this at the … | |
Re: > Hi, > > Sorry will try to use code tags (I tried last time!) it is just (code) at the start (icode) at the end. > It is a little large shall I just post the bits that are causing problems? > Glenn Code tags should be (CODE) and … | |
Re: Hi, you have working code that takes the user input and displays it in Math format, is that correct? If so, could you post that code here and we can show you how to rework it :) | |
Re: Ok, firstly you need to retrieve the lsit of button ID's and Descriptions from the database, check out the link Antenka gave you or google for one of the many many tutorials on c# database access. You said you want to use an array, i'm assuming that will be to … | |
Re: [QUOTE=xyz12;1035324]No this is not working........... Actually i have entered the string on runtime, and entered string can be anything.............. I want that when i run the program then in that case one dot(.) is automatically appear in the textbox, but that is hidden for others, and if anyone wants to … | |
Re: One way would be to limit the keys the user can press: [CODE] private void TextBox_KeyPress(object sender, KeyPressEventArgs e) { //only allow numbers and control keys if (!char.IsDigit(e.KeyChar) && !char.IsControl(e.KeyChar)) { e.Handled = true; } else if (char.IsControl(e.KeyChar)) { e.Handled = false; } else { //using this rather than TextBox.Text.Length … | |
Re: You are adding a MosueHover event to the form. Try: [CODE] this.simpleButton1.MouseHover += new System.EventHandler(this.simpleButton1_MouseHover); [/CODE] if you want to change the back colour when the mouse is over the button you would be better to look at MouseEnter and MouseLeave so that you can change the colour back when … | |
I've been making more of an effort lately to build better OO designs, creating classes for distinct collections of members etc. However, i've hit a bit of a wall in my project. The program is designed to control an automated watering system. The system is split into multiple bays which … | |
Re: as ddoubled said, the code looks sound. If you are still having problems you can attach your project here or post the full code so we can check if something is being changed elsewhere :) | |
Re: [QUOTE=sknake;1030267][B]>>In the code that follows, you will find my changes easily, because it is practically the only code that has comments![/B] :( I am pretty bad about not commenting[/QUOTE] Likewise, my uni projects were always perfectly commented and beatifully designed...only problem was, i did ALL the commenting and drew up … | |
Re: you can buy secure pen drives...they have the security built in and i've seen some that destroy data if an attempt is made to forcably bypass the security. Sometimes its better not to re-invent the wheel ;) | |
I know how to handle multi-dimensional arrays, but whats the best way to represent them on a form?? Not sure how best to describe the problem : / Its an order form. Each row represents a product, each column represents the week we're ordering for. The problem is the order … | |
Re: [QUOTE=sumit21amig;1027344]How can i maintain operator's precedence order while overloading "+" and "*" in a class? e.g. I want same result on the calculation of following objects: d=a+b*c; d=c*a+b; Please help! Also tell me why simple constructor is able to call static data in a class?[/QUOTE] As ddanbe pointed out, multiplication … | |
Re: Hi, You have a lot of code repeated in each 'if' statement, the only thing thats affectedby the initial choice is the base cost. Why not collect all the variables first then do a single calculation at the end: [CODE] class Program { static void Main(string[] args) { double roomPrice, … | |
Re: I agree that Dani deserves kudos for trying new ideas and keeping the site fresh. However, my concern is that this voting system is uncomfortably similar to the eBay feedback system (among others) which i detest. Having worked for companies that trade on eBay i know first hand how frustrating … | |
Re: This happens to me all the time, i post a problem then fix it myself...even if i've spent horus trying before posting. In fact, more than once i have solved the problem WHILST writing the post haha, somehow organising things in the post to make them understandable to readers, also … | |
Re: [QUOTE=chandru7;1019202]copy means,you wants to pass the values from one page to another right,try session or hiddenfield.[/QUOTE] Those are both web concepts and wont help in a winforms environment. If you are creating an instance of the form2 when you click the button you can add the variables you want to … | |
Re: [CODE] Console.Write("\n No, do you care about your baby?\n"); if (iQuickAnswer == 'y') // nested if in nested else [/CODE] You arent checking for the users input here. You need to include another [iCODE]iQuickAnswer = Console.Read();[/iCODE] to capture what they enter. Otherwise, it will use the same answer to the … | |
Re: [QUOTE=Antenka;994273]Hello, S2009. Ok, now few words about ControlBox. I suppose it would be more understandable for user if you will show/hide ControlBox in some other place. E.g. make it hidden when loading form and show it while logging off. Also just a few thoughts in loud. I don't know if … | |
Re: please use CODE tags to post code. It makes it a LOT easier to read through your code :) | |
Re: Is there a reason you have used a SingleLinkedList? I personally would have gone for something more strongly typed: [CODE] //private collection that you can add/update/remove private List<DictionaryEntry> _dictionary; //class to store each entry with public properties to access values public class DictionaryEntry { private string _word; private string _description; … |
The End.