624 Posted Topics

Member Avatar for himanshu091

I don't even know how to make a 'Hello World' app in java, and I make more money with a 2 year technologist diploma writing in C#, VB.Net and VB6 than a Mechanical Engineer with 7 years experience and a nearly complete masters degree that also works for my company. …

Member Avatar for Netcode
0
221
Member Avatar for techlawsam

It is explicitly casting an integer to a double datatype. Dividing 2 integers yields undesired results as an integer divided by an integer will have an integer result (decimals get truncated). Go ahead and try it without the cast with values whose quotient is not a whole number.

Member Avatar for techlawsam
0
180
Member Avatar for babalipk

This is a simple example of how to do this with events/delegates: In Form1: [code] //Declare the delegate that will point to the text-setting method public delegate void TextChangeHandler(object sender, string s); //Declare the event that is to be raised when the text changes public event TextChangeHandler TextChange; //This button …

Member Avatar for skatamatic
0
146
Member Avatar for Troebadoer

Calling GC.Collect() will force the garbage collector to 'catch up' with memory freeing. And like Momerath said, calling Dispose() on a class that implements the IDisposable interface will tell the GC to free up the memory associated with the reference. I don't think this is [B]required[/B] as he said though, …

Member Avatar for Troebadoer
0
229
Member Avatar for OblibSystems

C would have C++ in an armbar, but unfortunately the C developer made a typo in the finish_armbar() routine so he can't break off C++'s arm. C# would be watching the whole thing from across the street behind a thick glass bubble, chuckling to himself.

Member Avatar for ddanbe
0
440
Member Avatar for johnt68
Member Avatar for majorawsome

This doesn't seem to have anything to do with interfaces. If you don't want to have an instance of a class while still accessing its members you should consider making it a static class. (Assuming you are using a newer version of C# that supports automatic properties) [code] namespace myProgram …

Member Avatar for majorawsome
0
156
Member Avatar for NeilA
Member Avatar for skatamatic
0
54
Member Avatar for Zvjezdan23
Member Avatar for Mitja Bonca
0
1K
Member Avatar for AirWave
Member Avatar for haanjae

It would be a good idea to put some error handling around networking code. Fortunately, C# has a try/catch/finally construct for situations like this... [code] try { //put your network code here } catch (SocketException se) { //put code here to handle a socket error (message box or a log …

Member Avatar for Mitja Bonca
0
2K
Member Avatar for Shizuo

[URL="http://forums.whirlpool.net.au/archive/391152"]Seems like[/URL] in MSSQL that if you just subract an integer from a datetime it defaults to subtracting days. Not sure about MySQL though. Let me know if you have any success with just using an integer. Also, apperantly if you use a decimal it defaults to represent a fraction …

Member Avatar for Mitja Bonca
0
104
Member Avatar for ganil_22

Google has taken me [URL="http://www.codeproject.com"]here [/URL]enough times to remember the uri

Member Avatar for skatamatic
0
112
Member Avatar for techlawsam

[QUOTE=Momerath;1649362]Two things: 1) [I]return[/I] ends the execution of the current method and if that method has a return type, tells it what value to return. 2) Both of your parameters are integers, so the division in your return statement is integer division. It is then converted to a double (the …

Member Avatar for nick.crane
0
244
Member Avatar for mrnutty

I used to get laid. For some reason most girls just don't see the beauty in polymorphism or lambda calculus....

Member Avatar for chiiqui
0
449
Member Avatar for coolsasuke

VB.Net and C# are nearly identical (they use the same framework). There's mostly just a few syntactial differences between the two. Instead of posting entire code blocks and expecting us to kindly convert it for you, try and learn these syntax differences and post any specific problems you might be …

Member Avatar for skatamatic
0
628
Member Avatar for Asotop

I am not sure you need to nest all of those if statements together. I mean, it will definately do what you want, it's just hard to look at from another programmers perspective. [code] string errString = ""; if (double.TryParse(aConstantTextBox.Text, out aConstant)) { if (aConstant == 0) { errString += …

Member Avatar for skatamatic
0
140
Member Avatar for coolsasuke
Member Avatar for Cap'nKirk
Member Avatar for Cap'nKirk
0
135
Member Avatar for Alokkumar11

I can't believe someone replied to the OP. That's probably the worst post I've ever seen on Daniweb.

Member Avatar for skatamatic
-2
185
Member Avatar for c1ockwerk

This might be lending any help to your problem...but why is there a Thread.Sleep() in that loop? It seems quite literally like a waste of time.

Member Avatar for skatamatic
0
159
Member Avatar for james6754

What kind of functionality are you trying to accomplish? Usually threads aren't passed around the way you are describing and suspending a thread is not really supported anymore. Suspending is deprecated and should not be used, but Join() might be what you are looking for. I haven't really used it …

Member Avatar for skatamatic
0
212
Member Avatar for ddanbe

[QUOTE=Evenbit;1624883]Actually, Roman Numerals are quite common in industrial settings. For instance, "25L" would mean 25 stacks of 50 items. You probably run into them quite often on a daily basis without realising it because you are simply not looking for them or simply unaware that that is what the letter …

Member Avatar for gracefull
0
1K
Member Avatar for skatamatic

I work for an instrumentation company as an in-house software developer. We are thinking of restructuring our database that we use to record data. I am wondering what would be more efficient. Basically theres an array of sensor values Starting at Data0 and ending with data appended with the sensor …

Member Avatar for rikthefrog
0
342
Member Avatar for skatamatic

I work for an instrumentation company as an in-house software developer. We are thinking of restructuring our database that we use to record data. I am wondering what would be more efficient. Basically theres an array of sensor values Starting at Data0 and ending with data appended with the sensor …

0
114
Member Avatar for sneekula

When you start writing scripts that write other scripts to solve a problem that you can't even remember anymore.

Member Avatar for Netcode
0
674
Member Avatar for fredw300

Yes. Parse through the file building a string (the file contents) then if the bookmark keyword is encountered insert the 'special' text into the string, and carry on with the file/string building.

Member Avatar for fredw300
0
445
Member Avatar for king03

[QUOTE=Lightning03;1625448]hi there guys I need help how do I make my check box a single click one? I have to double click my checkbox in order to select a particular item but I want to just click once. Any ideas how?[/QUOTE] Why are male students charged more?! By the way, …

Member Avatar for king03
0
100
Member Avatar for BCMusic24

Seems like you need to save this data somehow.... A simple text file would suffice, but for settings like this I (and many others) prefer to go with XML. Example XML: <Settings> <button_data buttonID="1">C:\MyPath\File.exe</button_data> <button_data buttonID="2">C:\MyPath\File2.exe</button_data> <button_data buttonID="3" specialoption="RunInBackground">C:\MyPath\File3.exe</button_data> </Settings> Millions of tutorials on file IO and XML are available …

Member Avatar for nick.crane
0
91
Member Avatar for westony

dr is the temporary reference to the current DataRow in dtPeople.Rows . In a foreach statement, since you are not necessarily accessing an array like you would with a regular for loop there needs to be some way to reference the current item. In this case 'dr' does just that.

Member Avatar for nick.crane
0
111
Member Avatar for bhagawatshinde

Could you not write a stored procedure to do the backing up? [URL="http://www.noupe.com/how-tos/10-ways-to-automatically-manually-backup-mysql-database.html"]This[/URL] might help.

Member Avatar for bhagawatshinde
0
387
Member Avatar for vishal1949

As soon as you have a class directly accessing a specific form you are asking for problems... It is probably safer to use a function that takes a reference to a form instead. [code=csharp] public class Vehicle { protected float m_mpg; protected float m_tankCapacity; protected float m_odometer; protected float m_gasRemaining; …

Member Avatar for vishal1949
1
177
Member Avatar for singh_soorma94

.Net has a class for that. [code=csharp] Random ran = new Random(); int i = ran.Next(10); //This will make i an integer between 0 and 9 for (int x = 0; x < i; x++) //Do stuff [/code] Hope this helps!

Member Avatar for skatamatic
0
152
Member Avatar for jlivvers

select * from tbl_student_courses where studentID = myID insert into tbl_student_courses values (@myID,@otherdata) update tbl_student_courses set (otherdata=@myOtherdata) where studentID = myID Hard to tell how to help you since you didn't give us your database schema. These are some standard, non-specific examples that hopefully you may learn from.

Member Avatar for skatamatic
0
109
Member Avatar for SVR

It might be useful to post your code that you have so far so that we can sugguest modifications.

Member Avatar for SVR
0
147
Member Avatar for BoBok2002

Without context or definitions of some of these functions/classes, it's hard to tell what isn't being initialized. Have you tried stepping through the code to find out exactly which line the error is occuring on? There's a few functions that I am not sure what they are doing. For example, …

Member Avatar for cudahead
0
234
Member Avatar for yousafc#

Try posting the work that you have done so far. If you are looking to be spoon fed the exact sql command to query your database, we are at least going to need to know a bit more about the database... SELECT LastBalance FROM tablename WHERE condition_is_true The condition will …

Member Avatar for yousafc#
-2
104
Member Avatar for malcsapi

Well...maybe post what you have learned in school so we can judge more precisely what 'not very advanced level' means. Is this an AJAX project? ASP.NET with C#?

Member Avatar for malcsapi
0
107
Member Avatar for vishal1949

Please use code tags. To do this, put [ c o d e ] [ / c o d e ] around your code. It makes it easier for us to read. Seems like you need to put that randomizing code into a loop... [code=csharp] int[] numOccurrence = new int[12]; …

Member Avatar for ddanbe
0
1K
Member Avatar for zachattack05

Instead of sending back the whole dataset, maybe send back a class that contains the [B]changes[/B] made. Eg. [code=csharp] [Serializable] public class ClientRequestDBChange { public enum ChangeType { AddRecord, EditRecord, DeleteRecord } public ChangeType _ChangeType {get; private set;} public string[] _data {get; private set;} public string _table {get; private set;} …

Member Avatar for zachattack05
0
94
Member Avatar for pseudorandom21

Well this isn't really a sequence since it must all be happening at the same time. SOmething like this might work: [code=csharp] private void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.Modifiers == Keys.Shift && e.KeyCode == Keys.ControlKey) bKeysDown = true; } private void Form1_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode …

Member Avatar for gusano79
0
125
Member Avatar for galiz05

OP - Being rude, whiney and racist will get you nowhere in life. I was about to just flame you into the ground, but seeing as you seem genuinely interested I decided to tone my post down a bit. I don't think any one person on this forum (or anywhere …

Member Avatar for yup790
-1
743
Member Avatar for zachattack05

Looks like that will work. Instead of using hardcoded values, maybe consider using the sizeof(int/etc) keyword. It will give you the size of a datatype relative to the current system architecture. This got me to thinking...there must be a way to make a generic class serializer that isn't as bloated …

Member Avatar for skatamatic
0
2K
Member Avatar for WildBamaBoy

I wrote a fragmented file class to handle this sort of thing. This is a simplified version of it: [code=csharp] using System; using System.Collections.Generic; using System.Text; using System.Net.Sockets; using System.IO; namespace fragfile { public class FragmentedFileSender { private string _sourcePath; private int _fileBytes; private int _PieceSize; public FragmentedFileSender(string filePath, int …

Member Avatar for WildBamaBoy
0
409
Member Avatar for jas2010

OR just use tab indexes. It is a property of all editable controls in .Net . Remember to set TabStop = true. Also, remember that TAB will increment the currently selected tab index, and Shift-Tab will decrement it. No use in writing custom event code for something that is already …

Member Avatar for prasan7
0
91
Member Avatar for zack_falcon

The [B]EASIEST[/B] method would be to share a folder on both machines where files can be saved (ie full access). This would work best with only 2 players. Example: \\COMPUTER1\GameData\data.txt Have some sort of timer checking this folder for data on Computer1. If it has a file, load its contents …

Member Avatar for zack_falcon
0
183
Member Avatar for arsenalfun

Hard to tell without actually seeing the machine. Try removing the battery and powering it with [B]only[/B] the AC adapter. If this doesn't work try holding the power button in for about 15 seconds. This will flush any residual power being stored in capacitors on your motherboard. If neither of …

Member Avatar for faroukmuhammad
-1
207
Member Avatar for Dr peter

Yeah that kind of seems like overkill. I am not sure how many CPU cycles all that would take, but if you are using the random numbers for something useful (like a statistical simulation) the less CPU the better. I would say seeding Random() once with that method should suffice. …

Member Avatar for shiva07
0
140
Member Avatar for k.d.m

This really depends on how hard you want it to be to crack your software. If you are fine with about 15% of your target market using your software for free, just using a file containing an encrypted key unique to each distribution should work. This way they must enter …

Member Avatar for skatamatic
0
110
Member Avatar for Falcon25

Not the most efficient algorithm, but pretty simple and self explanatory: [code=csharp] public long GetLargestPrimeFactor(long lNum) { List<int> iFactors = new List<int>(); //Get all the prime factors for (int i = 1; i <= lNum / 2; i++) if (lNum % i == 0) { iFactors.Add(i); lNum /= i; } …

Member Avatar for Falcon25
0
231

The End.