889 Posted Topics
Re: Can you post your code of where you attach the Map attribute to the Variant node in your application? | |
Re: Check your opening { and closing } throughout your file. The sample you provided closes the class very early in your code... | |
Re: Hilarious post, thanks for sharing almostbob :) And all you lot, come to Australia and visit us eh? | |
Re: You can use a [URL="http://msdn.microsoft.com/en-us/library/system.io.filestream.aspx"]FileStream[/URL] for this: [code] string filepath = "C:\\test.html"; using (FileStream output = new FileStream(filepath, FileMode.Create)) { provider.Export(document, output); } [/code] | |
Re: You could use the String.Split function to split each line according to where each space is. Then you could just substring from the = signs to get the digits. Something like this (untested but should give you an idea): [code] while ((s = sr.ReadLine()) != null) { string[] chunks = … | |
Re: MATLAB is another popular mathematical scripting language. | |
Re: Not sure what you mean by the first one, but for 2, it is easier and more accurate to use an identity field in the database. | |
Re: [URL="http://www.delphibasics.co.uk/index.html"]DelphiBasics[/URL] is a great starting point. Two very basic tutorials, lots of sample code and descriptions of many commonly used units will give you a start. | |
Re: Check out the [URL="http://msdn.microsoft.com/en-us/library/system.io.fileinfo.aspx"]FileInfo[/URL] class. This gives access to creation, access and modified dates. Not sure about tags and the like, possibly the FileInfo.GetAttributes method might return these (and SetAttributes to modify them?) | |
Re: I have never used the WebBrowser control, but my understanding of it was that it was simply a frame for viewing web pages. I believe you need to implement other controls such as a Back button and call the browser's GoBack function when the button is pressed. | |
Re: Use [URL="http://logging.apache.org/log4net/"]log4net[/URL], it is thread-safe and can log to various different appenders including a text file (RollingFileAppender). | |
Re: Your SQL is attempting to put the value 'False' (as in the string) into a tinyint (which is numeric) column. You need to check the boolean value and assign it to a 0 or a 1. You are converting it to a string by setting it the way that you … | |
Re: Without a WHERE clause in your SQL statement the UPDATE function will change data of every record in the table. I would suggest changing the statement to something like: [code=sql] Update Lib_member_details set member_name=@member_name,member_address=@member_address,member_contact_number=@member_contact_number,member_email_id=@member_email_id,member_password=@member_password,membershiptype_id=@membershiptype_id WHERE member_id = @member_id [/code] Assuming that your database table has a member_id column and you … | |
Re: I don't think your main method belongs to the GeometricFigure class. The main method should go in the ShapesDemo class instead. Having said that, your project description tells you to accept a GeometricFigure parameter to a method in which it's figures (height, width, area) is displayed. Your method signature should … | |
Re: So what have you come up with so far? We aren't allowed to just hand you code, we need to see some sort of effort... | |
Re: I believe that it doesn't (although I could be wrong). However you can extend the class and override those operators to suit your needs. | |
Re: Or if you want to do it in SQL: [code=mssql] SELECT * FROM salesdetail WHERE DATEDIFF(YEAR, Date, CURRENT_TIMESTAMP) = 1 -- OR SELECT * FROM salesdetail WHERE DATEDIFF(DAY, Date, CURRENT_TIMESTAMP) = 365 [/code] | |
Re: The only encryptions worth using are one-way encryptions. C# has a few classes that can do this, the only one I have used is the [URL="http://msdn.microsoft.com/en-us/library/system.security.cryptography.rijndael%28v=VS.90%29.aspx"]System.Security.Cryptography.Rijndael[/URL] class, however you should use AES instead if you need a more secure algorithm. There is lots of sample code on the MSDN website … | |
Re: You are on the right track, except that your delimiter for the split function should be a comma ',' rather than a carriage return character '\r'. Once you have done the split, you will have three values in your split1 array - from unit, to unit and multiplier value. I … ![]() | |
Re: Rather than AppendLine, use Append. Your variable read contains an endline character since that is how the ReadLine terminates the line. [code] while ((read = f.ReadLine()) != null) { s1.Append(read); } [/code] | |
Hi all, Can someone tell me if this is a delphi bug? I am using a Controls.TDate to store a date and using the SysUtils.EncodeDate function to set the value. [code] Invoice.DateReceived := EncodeDate(2011, 03, 16); [/code] When I store it in a MS SQL database field, it is adding … | |
Re: To build a GUI, choose Windows Forms Application for the project type. A console application is one that runs on a command line or via a batch file. You are correct about adding a class. Your exe file will be created in your bin folder from where you save your … | |
Re: Don't get too hung up on which languages you need to learn. It's more about learning problem solving skills, design patterns, data structures and algorithms. I learned Java at university and about 1% of the commercial code I have written has been in Java. Once you know one language, subsequent … | |
Re: Hi pradvin and welcome to DaniWeb :) You will need to join your tables to get all of the information that you need. The syntax for a join statement is like so: [code] -- select which columns you need SELECT Table1.UnitID, Table1.Quantity, Table2.CostPrice, Table2.SellingPrice -- from which table FROM Table1 … | |
Re: Yes you can remove the <T> from the name of the function, like so: [code] static void foo(this List<T> list, T t) { ... } [/code] | |
Re: There are two ways that you can tackle this problem. Either make the ID field in the table an identity field then read it back after you insert the name, or you can retrieve the biggest ID number and add 1 to it using this value to insert. | |
Re: What type of join are you using on the tables? Cross joins in particular can be very slow with so many records, are you able to change to inner or left/right outer joins? If not, you could try running three separate select statements and filtering down the result set each … | |
Re: Your code should be correct, but you may possibly need to create a new object rather than trying to reuse your key object. [code] RegistryKey key = Registry.LocalMachine; var subKey = key.OpenSubKey(location, isWritable); // where location is the string of the address for the subkey // and isWritable is a … | |
Re: Try C# using Visual Studio for a windows solution to your needs. C# uses the .NET framework and allows you to design forms and use a code-behind method to handle events, data etc. If you need cross-platform Java has similar capabilities using NetBeans design mode. C++, C# and Java are … | |
Re: Really your question has many different answers depending on the individual. Personally I prefer Eclipse, but NetBeans is very popular. I used to use jEdit and I always liked it, but it wasn't a true IDE, just a text editor with a few plugins for java development. | |
Re: The easiest way is to store the arrays as properties of a class, then set the data source of your DataGridView to an instance of the class and add columns with the DataPropertyName set to the two properties that you created. Example: [code] public class MyContainer { public string[] Items … | |
Re: You can traverse child nodes quite easily in C#. Example: [code] // assume here I have a DataSource node called node foreach (XmlNode childNode in node.ChildNodes) { string nodeValue = String.Empty; // use a case insensitive search on the node name string childNodeName = childNode.Name.ToLowerInvariant(); if (childNodeName == "name") { … | |
Re: The SQL WHERE clause allows boolean logic operators AND and OR. You can combine your statement into one like so: [code] SELECT * FROM person WHERE lastname = @lastname AND firstname = @firstname AND ID = @id [/code] | |
Re: The easiest way is to use the [icode]Add[/icode] method of the [icode]Items[/icode] property of the listbox: [code] myListBox.Items.Add(myObjectToBeAdded); [/code] | |
Re: You can set the Form's StartPosition property to CenterScreen, CenterParent, WindowsDefaultLocation or WindowsDefaultBounds. Alternatively you can use the Location property of the form to set the X and Y coordinates of the form, in which case the StartPosition property should be set to Manual. Most often in your situation I … | |
Hi, It appears that the code tags in the MSSQL forum aren't working today. Example: [URL="http://www.daniweb.com/forums/thread348193.html"]this thread[/URL]. | |
Re: Hi DoubleJump and welcome to DaniWeb :) I personally think you should do whichever interests you the most, and only you can answer that. If you can't decide perhaps think about what career are you would like to pursue after you finish your studies and do some research about what … | |
Re: Hi Suzukaze and welcome to DaniWeb :) You need to join the tables, the syntax is like this: [code] SELECT g.GroupName, COUNT(m.MatricNo) AS "Member Size" FROM Group G -- join to the MemberOfGroup table INNER JOIN MemberOfGroup M -- describe how the tables are related ON m.GroupID = g.GroupID -- … | |
Re: I think the easiest way to stop your thread would be to break out of your while loop in the Reader method on a certain condition. [code] while (true) { if (shouldIStop()) break; msg = sr.ReadLine() + Environment.NewLine; allMessages += msg; Invoke(new Action(Output)); Invoke(new Action(AddNameList)); } private bool shouldIStop() { … | |
Re: You can use the BACKUP statement to perform a backup of your database, and a RESTORE to perform a restore of a database. [URL="http://msdn.microsoft.com/en-us/library/ff848768.aspx"]Here[/URL] is a link to the documentation for MSSQL2008R2 versions of these functions. Post back if you need help deciphering the documentation. | |
Re: Not sure if this will work, but I think you could create your own IFormatProvider from the english culture info object and use that when formatting the names of the time zones. Something like (adapted from [URL="http://www.csharp-examples.net/custom-iformatprovider/"]this post[/URL]): [code] public class EnglishFormatter: IFormatProvider, ICustomFormatter { private CultureInfo enCulture = CultureInfo.GetCultureInfo("en"); … | |
Re: There are a couple of ways to approach this kind of problem but I prefer to use a subquery in this case. Your query will be the subquery for the larger query, and we will select totals from that based on the SequenceID. I suspect your query looks something like … | |
Re: Yes, you need to create the primary key as an identity field. Note that this is only possible for numeric key fields (which you have in this case so that's ok). Simply add the word IDENTITY with the first value and increment values in brackets into your field definition, like … | |
Re: I would have one table, Visitor, then have a VistorType column that determines whether you are dealing with a student, employee or volunteer. This way you only have to join to one table from other tables that need to know about visitor information, rather than trying to join to the … | |
Re: Create a property in your base class to house the gamescore enum like so: [code] public gamescore GameScore { get; set; } [/code] Then in the constructor of each class, set the GameScore property accordingly, for example: [code] public MotherShip() { GameScore = gamescore.MotherShip; } [/code] Then in your Die() … | |
Re: Do you need to initialise your Matrix temp to contain all 0's before performing your sums? The += operator might cause issues if the double temp.matrix[i,j] hasn't been initialised properly. | |
Re: Hi prosperr and welcome to DaniWeb, Unfortunately we aren't allowed to do your homework for you. We need to see that you have at least thought about these questions before we can even give you a point in the right direction. How do you think these questions should be tackled? … | |
Re: Is the CHM file on the PC running the application or in a network location? A security issue exists where windows will block CHM content when served over a network. | |
Re: From MSDN Docs: [QUOTE] The FormBorderStyle, MinimizeBox, and MaximizeBox properties allow you to control whether the form can be minimized, maximized, or resized at run time. [/QUOTE] The FormBorderStyle property has an affect on size and location of your form. Sizable is the default setting. [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.form.formborderstyle%28v=VS.90%29.aspx"]Here[/URL] is a link to … | |
Re: 1. A static method belongs to the class, not to an instance of the class, so the instance variables have no meaning in a static context. You need to create an instance of your class in the static method, then access any public instance variables, properties or methods of the … |
The End.