889 Posted Topics

Member Avatar for CHOCHOCHO

[URL="http://msdn.microsoft.com/en-us/library/system.math.aspx"]Here[/URL] is a link to the MSDN docs for the System.Math class. Take a look and see if there is any method in there that can help.

Member Avatar for kvprajapati
-2
358
Member Avatar for python01

Australian Rules Football. See [URL="http://www.afl.com.au/"]the AFL website[/URL] for details of this amazing sport.

Member Avatar for Toni Chopper
0
295
Member Avatar for MasterGberry

This statement is a LINQ statement which selects all members of the list (or enumerable) named patchFiles which meet the condition of the method TryReadPatch (I don't know this method sorry) into an array named allPatches. I'm not sure if C++ makes use of LINQ, try a google search to …

Member Avatar for MasterGberry
0
90
Member Avatar for Kreative

You will need a pretty good understanding of how to use I/O in java to do this assignment. Take a look at the java API in the java.io package and I'm sure there are some tutorials on the sun website about I/O. The rest of the program is just a …

Member Avatar for Akill10
-1
217
Member Avatar for vedro-compota

Also, you should use the static [icode]String.IsNullOrEmpty[/icode] method to check for uninitialised strings.

Member Avatar for Farhad.idrees
0
180
Member Avatar for faintfascinatio

Not sure if this will help you, but you can use LIKE when trying to match strings in SQL. To take your example: [code=mssql] select * from Customer where FirstName LIKE 'Jim%' AND LastName LIKE '%Sau%' [/code] This will select all customers whose first names start with Jim and last …

Member Avatar for kvprajapati
0
113
Member Avatar for UsSy

Yes you are correct, however string is a bit of a special case in the way that it is initialised. A better description of objects is to look at your post in your other thread where you had: [code] Human human = new Human(); [/code] In this example, you are …

Member Avatar for darkagn
0
141
Member Avatar for UsSy

Your call to create your new Human object is calling the constructor method for the Human class, it is not itself a constructor. Calling the constructor of a class is the only way of creating a new instance of your class. You can have a different method that returns a …

Member Avatar for Momerath
0
88
Member Avatar for james6754

Your call to Message.Show is wrong, you need to add String.Format like so: [code] MessageBox.Show(String.Format("{0}",hello2(2))); [/code] Also, it doesn't matter what number gets passed as the parameter to your hello2 function, it will always show 10 / 5. A better implementation would be: [code] private void button1_Click(object sender, EventArgs e) …

Member Avatar for Farhad.idrees
0
149
Member Avatar for vedro-compota

The following if-statement is equivalent to your switch statement. You can see from this code that Narue is correct: [code] if (fillnumb == 0) fillnumb = 1; else if (fillnumb == 1) fillnumb = 2; [/code]

Member Avatar for vedro-compota
0
131
Member Avatar for m_wylie85

I see two potential issues with your code: [code] // first call to ReadLine() advances the stream foreach (string record in reader.ReadLine().Split('|')) { // first time will read the second line because of first call while ((line = reader.ReadLine()) != null) { if (Regex.IsMatch(line, searchText, RegexOptions.IgnoreCase)) { // the text …

Member Avatar for iconoclazt
0
122
Member Avatar for prayag.419

Without further information about the application you are building, the only minimum requirement is the .NET Framework 4.0. It can be downloaded freely from the MSDN website.

Member Avatar for darkagn
0
52
Member Avatar for eyndyel

The String method compareToIgnoreCase should do the trick. For example: [code=java] int result = string1.compareToIgnoreCase(string2); // here result < 0 if string1 > string2 // or result = 0 if string1 == string2 // or result > 0 if string1 < string2 [/code] That should give you a start anyway. …

Member Avatar for jon.kiparsky
0
177
Member Avatar for WildBamaBoy

In your form add a property like so: [code] public decimal Answer { get { return Convert.ToDecimal(AnswerBox.Text); } set { AnswerBox.Text = value.ToString(); } } [/code] Then in your other class add a reference to the form and set the Answer property accordingly. [code] class Calculator { private MyForm form; …

Member Avatar for darkagn
0
140
Member Avatar for potsy

Check out the [URL="http://msdn.microsoft.com/en-us/sync/default.aspx"]Microsoft Sync Framework.[/URL] It's a bit of work to set up in your application but once up and running it works a treat.

Member Avatar for potsy
0
219
Member Avatar for Gdyson

You need to join to the tblRespondentsChildren table twice, once for each child. Something like this should give you a start: [code] SELECT r.FirstName, r.Surname FROM tblRespondents r INNER JOIN tblRespondentsChildren rc1 ON r.RespondentID = rc1.RespondentID INNER JOIN tblRespondentsChildren rc2 ON r.RespondentID = rc2.RespondentID WHERE rc1.DOB BETWEEN ('1998-09-01') AND ('1999-08-31') …

Member Avatar for darkagn
0
151
Member Avatar for MKARWOSK

There are a few things that could be better with your code, but your syntax error is caused by this: [code] i_EmpPayGrade) (s_String, i_Integer) [/code] which I believe should be this: [code] i_EmpPayGrade, s_String, i_Integer) [/code] You should really use a parameterised query to pass all of those variables to …

Member Avatar for darkagn
0
114
Member Avatar for balrogf

From the MSDN documentation on [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.picturebox%28v=VS.90%29.aspx"]PictureBox[/URL]: [code] // Stretches the image to fit the pictureBox. pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; MyImage = new Bitmap(fileToDisplay); pictureBox1.ClientSize = new Size(xSize, ySize); pictureBox1.Image = (Image) MyImage; [/code] You can substitute pictureBox1 in the above example for choices[0] in your code. fileToDisplay is the string filepath. …

Member Avatar for darkagn
0
88
Member Avatar for darkagn

Hi all, Well this is my 1000th post here at DaniWeb and I thought "What better way to celebrate than by posting my first ever code snippet?" This problem occurred in an application that I am working on. I have a password field in my form that was specified as …

Member Avatar for darkagn
2
380
Member Avatar for markaman

In MySQL, you need to enter a date in the format "YYYY-MM-DD", so with your three variables you can make the date string in that format using the date and mktime functions. Something like this should work: [code=php] // date needs format and timestamp // mktime needs hours, minutes, seconds, …

Member Avatar for luespi
0
177
Member Avatar for DaveTran
Member Avatar for UsSy

Your first dialog is close but should make use of the overriden method for MessageBox.Show like so: [code] DialogResult r = MessageBox.Show("Do you want to save changes?", "Save Changes?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); [/code] Then you can check the variable r to see which button the user pressed and take the appropriate …

Member Avatar for Mitja Bonca
0
157
Member Avatar for Xeros606

I prefer your method personally. I go one step further and put enums in their own file with an extension of the TypeConverter class to perform casts between an enum and a string.

Member Avatar for ddanbe
0
205
Member Avatar for Phil++

[QUOTE]I'm trying to open a file from a folder called "Assginement" however, when the program get's released, it might not be in a folder called this. What could I do? I've tried everything. [/QUOTE] If it is in the folder where the application is running from, use [ICODE]Directory.GetCurrentDirectory()[/ICODE] static method. …

Member Avatar for nick.crane
0
96
Member Avatar for DioRani

Change the parameters line to: [code] command.Parameters.AddWithValue("@user", selectuser); [/code] @user is the parameter, username is the column.

Member Avatar for crishjeny
0
126
Member Avatar for it2051229

I find that setPreferredSize tends to work more often than setSize although as jwentig has mentioned it is not guaranteed. A subsequent call to pack(), validate() or invalidate() often overrides any previous call to setting the size anyway.

Member Avatar for rincethomas33
0
160
Member Avatar for darkagn

I have noticed a small discrepancy between my Avatar in posts and my profile page. On the left you will notice that I have 995 posts to my name, but my profile screen says 997. I am unsure what the correct number should be. Normally I wouldn't worry about such …

Member Avatar for jonsca
0
150
Member Avatar for empyrean

This is a relatively simple task in C#. Copying files from one place to another can be done using either of the [URL="http://msdn.microsoft.com/en-us/library/bc33648k.aspx"]File.Copy[/URL] methods depending on your needs. Reading and writing from the database in C# is also straight forward. There are many tutorials out there, Google should provide many …

Member Avatar for darkagn
0
131
Member Avatar for jigglymig1

I would probably agree with that, but why do you think that implementations change more often than interfaces?

Member Avatar for darkagn
0
82
Member Avatar for nikesh.yadav
Member Avatar for Stefano Mtangoo
0
20K
Member Avatar for irandokht

Check out the [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.maskedtextbox%28v=VS.90%29.aspx"]MaskedTextBox[/URL] class. This is a text box that all data entry must follow a specific mask (format).

Member Avatar for irandokht
0
3K
Member Avatar for Ceerno

Hi Ceerno, Sorry to say but there are a number of problems with your code. The first thing I noticed was that your for-loops run from index 1 up to and including the Array length. Arrays are indexed from 0, so it should run from 0 to (but not including) …

Member Avatar for Ceerno
0
81
Member Avatar for Nivass

I think you are talking about the TextBox.ContextMenuStrip property? You can simply create a ContextMenuStrip (in Designer or in Code) and assign it to this property. If the property is not set, there is no ContextMenuStrip for the TextBox, that is there is no "inbuilt" ContextMenuStrip. Example: [code] ContextMenuStrip cms …

Member Avatar for darkagn
0
126
Member Avatar for haripriyamca05

Hi haripriyamca05 and welcome to DaniWeb :) Please note that there is an [URL="http://www.daniweb.com/forums/forum18.html"]ASP.NET[/URL] forum here at DaniWeb where you can ask ASP.NET questions. That said, all you need to do in your popup form is listen to the form Closing event, and read the TextBox.Text properties for each text …

Member Avatar for darkagn
0
183
Member Avatar for TheDocterd

Hi TheDocterd, This looks like Visual Basic code. It might pay to ask your question in the [URL="http://www.daniweb.com/forums/forum4.html"]Visual Basic 4 / 5/ 6[/URL] forum where someone who knows VB can help you. Also, please use code tags when posting snippets of your code for readability. Good luck and happy programming …

Member Avatar for darkagn
0
74
Member Avatar for rikiroxs

If you mean a barcode scanner, then each scanner will have its own communication protocol that you can talk to via serial port connection or some other means. You will need to read up on the technical specifications for the model you want to use. Often manufacturer's websites will have …

Member Avatar for rikiroxs
0
84
Member Avatar for acheo

You need to handle incoming connections on one thread, then handle each connection on an individual thread. [URL="http://www.switchonthecode.com/tutorials/csharp-tutorial-simple-threaded-tcp-server"]This tutorial[/URL] is a really good starting point for a TCP client-server model.

Member Avatar for darkagn
0
150
Member Avatar for SkyVValker

You can set the date format for your server using the [URL="http://msdn.microsoft.com/en-us/library/ms189491.aspx"]SET DATEFORMAT[/URL] function, but this will set the format for all dates in your system. I think the best way to go for you is to store the full date in the database (or even just 1-Aug-10 for all …

Member Avatar for shoestring
0
206
Member Avatar for AndreiZ3

Hi AndreiZ3 and welcome to DaniWeb :) You need to cast the tag back to a datarow, then you can access each part by their names, using the methods in the Convert class to convert to the datatype required. For example, [code] ListViewItem lvi = lvProductsOrdered.Items[lvProductsOrdered.SelectedIndices[0]]; if (lvi.Tag.GetType() == typeof(DataRow)) …

Member Avatar for darkagn
0
152
Member Avatar for Phil++

You can use the [URL="http://msdn.microsoft.com/en-us/library/fk49wtc1%28v=VS.90%29.aspx"]String.Replace[/URL] method for this purpose. What I would do is replace the string [var hello = ""] with your new string. Let's say you have read the file contents into a string called contents. Here is basically how you would do it: [code] public string SpecifyHello(string …

Member Avatar for Software guy
0
127
Member Avatar for svatstika

Hi svatstika and welcome to DaniWeb :) The easiest way to do this is to provide a reference to the input in your forms like so: [code] public partial class Form1: Form { // create a property to store the input from the user public string UserInput { get; set; …

Member Avatar for darkagn
0
177
Member Avatar for micahgeorge

There are lots of good tutorials out there, google will provide many. As for your elapsed time question, there are a number of ways to do this but here is the way I like to handle it: [code] // remember the time at the start DateTime start = DateTime.Now; // …

Member Avatar for micahgeorge
0
159
Member Avatar for hotdang

[URL="http://msdn.microsoft.com/en-us/library/dd383458.aspx"]Directory.EnumerateFiles[/URL] is one of many ways to do this.

Member Avatar for hotdang
0
139
Member Avatar for Ferny84

Test Driven Development is a methodology where you write test cases before you write the actual code, then write code to pass the tests and no more. For example, say we were writing a class to describe a square and we want a method that gives us the perimeter of …

Member Avatar for Ferny84
0
99
Member Avatar for zachattack05

The problem here is that the @DatabaseName in the command is not an SQL datatype field. You instead need to build your query like so: [code] public void CreateDatabase(string databaseName) { string query = String.Format("CREATE DATABASE {0}", databaseName); // now execute the query using DbCommand or similar class... } [/code]

Member Avatar for kplcjl
0
2K
Member Avatar for ohgee

Here is how you assign an event handler programatically (my example assigns an event handler to the Button.Click event): [code] public void SetupButton() { Button myButton = new Button(); // assign the event handler myButton.Click += new EventHandler(myButton_click); } // definition for the event handler code // note that the …

Member Avatar for darkagn
0
117
Member Avatar for sjn21682

You can use class properties to do this. A simple example: [code] public class MyClass { public string MyProperty { get; set; } } [/code] [code] public partial class MyForm: Form { private MyClass myObject; public MyForm() { InitializeComponents(); myObject = new MyClass(); } public void PassString(string str) { myObject.MyProperty …

Member Avatar for destruct0
0
1K
Member Avatar for andydeans

You need to quote your string N like so: [code] WHERE p.DATE IS NULL and p.TRUE = 'N' [/code]

Member Avatar for andydeans
0
85
Member Avatar for bonafos

We aren't allowed to just give you the code (what would that achieve?) Please show us your attempt and ask any specific questions for any problem that you may be having and we will be happy to point you in the right direction.

Member Avatar for sirlink99
-1
75
Member Avatar for d87c

You need to iterate over your array and write out each one individually. You can do this using a while, for or foreach loop. Have you been shown how to use any of these loops?

Member Avatar for JerryShaw
0
115

The End.