2,157 Posted Topics

Member Avatar for evilmarksman

[URL="http://msdn.microsoft.com/en-us/library/system.console.aspx"]Console[/URL] [URL="http://msdn.microsoft.com/en-us/library/system.string.aspx"]String[/URL] Everything you need is on those two pages. Post what you have as we aren't a homework service.

Member Avatar for zachattack05
0
102
Member Avatar for Usmaan

[code]Random r = new Random(); private string Method() { String[] myString = File.ReadAllLines("myfilename.txt"); return myString[r.Next(myString.Length)]; }[/code] Never put the new Random in a method that might be called repeatedly, you won't like the results. Put it outside the method, or in the constructor. If you are trying for 'random access' …

Member Avatar for Momerath
0
3K
Member Avatar for Farhad.idrees

[code]private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { if (listBox1.SelectedIndices.Count > 0) { button1.Enabled = true; } else { button1.Enabled = false; } } [/code]

Member Avatar for Farhad.idrees
0
100
Member Avatar for manugm_1987

It gives the current memory usages. If you don't have objects created for the forms, then it doesn't include them in the size. If you want maximum memory usage you'll have to create all the objects that could ever be created by your code before you check memory size. I'm …

Member Avatar for manugm_1987
0
202
Member Avatar for Arjun_Sarankulu

[code]myString = MyString.PadRight(1000);[/code] Adds spaces to the right side of the string until it is 1000 characters in length.

Member Avatar for Momerath
0
106
Member Avatar for MrCapuchino

[URL="http://mediainfo.sourceforge.net/en"]Mediainfo[/URL] is another one. And you just need to reference the DLLs.

Member Avatar for Momerath
0
93
Member Avatar for kimmi_baby

Properties don't have parameters. Your line 20 says that the method GetCount has zero parameters, which is not the same as not having them. Change the line to [code]public int GetCount { get { return n; } }[/code] readonly isn't needed as you don't provide a set method so there …

Member Avatar for lianpiau
0
109
Member Avatar for NicAx64

I once had a user (back in my mainframe days) who couldn't understand why her daily reports were always the same each day. When I asked what they did for processing each day, she said: [LIST] [*]Make backup of database. [*]Enter all the daily records. [*]Restore database from backup. [*]Run …

Member Avatar for Momerath
0
251
Member Avatar for Jessurider

To change the default icon of your .exe file click on : [LIST=1] [*]Project [*][Project Name] Properties [*]Application [*]Icon [*](From the Combobox select) <Browse…> [/LIST]

Member Avatar for lianpiau
0
90
Member Avatar for hopefree
Member Avatar for lianpiau
0
71
Member Avatar for lianpiau
Member Avatar for lianpiau
0
397
Member Avatar for zachattack05

There is no limit on the number of connections you can accept on a socket (baring memory limitations). I'm not sure what you are trying to accomplish. Do you want to limit the number of connections?

Member Avatar for zachattack05
0
2K
Member Avatar for SkyVValker

Go to the ODBC Data Source Administrator. Select the System DNS tab. Click Add Select SQL Server. Click Finish. Fill in form values for your server. Done.

Member Avatar for Momerath
0
66
Member Avatar for RicardoE

To test the speed of foreach vs LINQ I created ten million GUID then randomly picked one to search for. The two methods tested where: [code]foreach (String s in myList) { if (s.Equals(toFind)) { found = s; break; } } var found = myList.Find(n => n.Equals(toFind));[/code] There was no difference …

Member Avatar for Momerath
0
134
Member Avatar for apierce

[URL="http://www.rhi.com/"]Robert Half[/URL] pays weekly, as does [URL="http://www.adecco.com/Pages/default.aspx"]Adecco[/URL]. You get about 50% of what they charge

Member Avatar for apierce
0
193
Member Avatar for Jessurider

In the file program.cs you'll find the line [icode]Application.Run(new Form1()); [/icode]. Change the Form1 to Form2.

Member Avatar for Jessurider
0
60
Member Avatar for Jessurider

From line 41 of form1.cs :[code]if (progressBar1.Value == 100) { Form1 f = new Form1(); f.Hide(); Form2 f1 = new Form2(); f1.Show(); }[/code] Why are you creating another form1? Did his sample code show him creating another form1? No, so don't do it. [code]if (progressBar1.Value == 100) { this.Hide(); // …

Member Avatar for Jessurider
0
86
Member Avatar for 303factory

It's a lot easier than that: [code]int a = 1; sourceType b = (sourceType)a;[/code] Any int can be cast into any enum. If it is valid, ToString() will show the text of the enum, otherwise you'll get the number. For example: [code]int a = 1; sourceType b = (sourceType)a; Console.WriteLine(b.ToString()); …

Member Avatar for 303factory
0
112
Member Avatar for anilsambasivan

You'll have to make heavy use of reflection and make sure you get the attributes (XmlAttribute, XmlElement, XmlRoot, XmlIgnore, etc.) and execute the appropriate methods (OnDeserializing, OnDeserialized, OnSerializing, OnSerialized). You'll need to determine what order your serializer will place attributes (alphabetical, as coded order, as specified by attributes) and if …

Member Avatar for anilsambasivan
0
143
Member Avatar for cwarn23

No, it's not the greatest method ever. The Newton-Raphson method is faster and you have a lot of inefficient code in there. Doing one square root shouldn't take enough time to be measurable on any computer made after 1990. If you can actually get a real time measurement, you are …

Member Avatar for mrnutty
0
843
Member Avatar for AngelicOne

Yes, use the convert() function like in [URL="http://www.daniweb.com/forums/thread350476.html"]this[/URL] post.

Member Avatar for Momerath
0
152
Member Avatar for Robert955

Well, if you take a look at the method UpdateMenu you find [icode]public void UpdateMenu(GameTime gameTime)[/icode]. Your call to it doesn't pass a gameTime object, thus the error. The rest of your errors are similar in nature. When a method needs an object, you have to pass that object to …

Member Avatar for Robert955
0
369
Member Avatar for InceptThis

Some psuedo code to help you along [code]Get amount from user while amount > 0 for (int i = 0; i < length of coin value array; i++) coinamount[i] = amout / coinvalue[i]; amount = amount % coinvalue[i]; end if Display the values in cointamount array Get new amount from …

Member Avatar for Momerath
0
189
Member Avatar for Dracata

SELECT a.Term, b.Term From Term a, Term b, TermHMRelatedTerm c WHERE a.ID = c.TermID and b.ID = c.RelatedTermID Just FYI, there is no Gamma->Beta (there is Beta->Gamma) and your output is missing Charlie->Beta (in your 'what I want' data).

Member Avatar for Dracata
0
123
Member Avatar for imobby

Find Find/Replace Font Font size Font attributes (Bold, Italic, underline) Font color Cut Paste Copy Indent Align left Align right Align center Pick one of these, implement it, pick another. Keep going until you've done them all or your two months are up. Do one at a time and once …

Member Avatar for alasser222
0
147
Member Avatar for Robert955
Member Avatar for AngelicOne

You'll need four select statements and some if/else statements. I'd make sure the -- ALL -- always had an index of 0 for ease of use.

Member Avatar for Momerath
0
138
Member Avatar for AngelicOne

The 101 refers to the output format for the date conversion. You can see all the style values [URL="http://msdn.microsoft.com/en-us/library/ms187928.aspx"]here[/URL]

Member Avatar for Momerath
0
247
Member Avatar for ajinkya112

You create a dataset then try to retrieve a table from it, but you haven't loaded anything into the dataset. You then try to get a row from the non-existent table, then data from the non-existent row. You should read [URL="http://msdn.microsoft.com/en-us/library/ms171920%28v=vs.80%29.aspx"]this[/URL].

Member Avatar for Momerath
0
136
Member Avatar for narendera22

Does the table your are trying to fill exist? Do all the column name/types match? What error are you getting?

Member Avatar for Momerath
0
157
Member Avatar for AngelicOne

I don't see anywhere in your code that you set the image property of the picturebox control. Is there code missing?

Member Avatar for AngelicOne
0
1K
Member Avatar for RicardoE

You don't say how you are connecting to the MySQL database. Are you using OleDB or one of the many MySql to .Net libraries? Have you tried a different method? Post your DB code (probably the C# forum would be a better place) and maybe we can point out something …

Member Avatar for Momerath
0
108
Member Avatar for divyakrishnan

Since they are strings, 9 comes after 1. You'll have to convert them to numbers if you want numerical sort order ([icode]cast(substring(st_no,3,4) AS INT)[/icode]), assuming they are all numbers. Since they also have string part, you'll have to split them into two fields ordering first on the text, then on …

Member Avatar for Momerath
0
113
Member Avatar for deolalkar_pooja

select type, sum(price), avg(discount) from interiors where name = 'baby cot' group by name Not tested, YMMV.

Member Avatar for Momerath
0
113
Member Avatar for deolalkar_pooja
Member Avatar for Momerath
0
82
Member Avatar for Kath_Fish

[code]public String[] GetWordsFromFile(String filename) { List<String> myWords = new List<String>(); if (File.Exists(filename)) { String[] myStrings = File.ReadAllLines(filename); foreach (String line in myStrings) { String[] words = line.Split(new char[] {' ', '\n', '\r', '\t'}, StringSplitOptions.RemoveEmptyEntries); foreach (String word in words) { myWords.Add(word); } } } return myWords.ToArray(); }[/code]

Member Avatar for Kath_Fish
0
327
Member Avatar for jackabascal

This method will allow you to italicize between any two characters. You can even specify a starting point if you want (works for .Net 4.0, otherwise remove the '= 0' default specifier and it will work under anything, but you'll have to provide all three parameters). [code]private void Italics(RichTextBox r, …

Member Avatar for Momerath
0
157
Member Avatar for hmnetonline

Take a look at [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.checkbox.aspx"]CheckBox[/URL]

Member Avatar for Mitja Bonca
0
136
Member Avatar for Kath_Fish
Member Avatar for Jake.20

There is no code that you have given that adds days 30 or 31 (just 29 for leapyear). Why do you expect it to add days?

Member Avatar for Jake.20
0
619
Member Avatar for Kath_Fish

[code]int[] StringToInt(String[] input) { int[] output = new int[input.Length]; for (int i = 0; i < input.Length; i++) { output[i] = Int32.Parse(input[i]); } return output; }[/code] There is no error checking in this code. Passing a null array or anything in the string array that isn't an integer will throw …

Member Avatar for Mitja Bonca
0
215
Member Avatar for virusisfound
Member Avatar for arshalan
Member Avatar for techsurge

I think the major issue you'll have is that the hover event only occurs one time. It won't fire again until you move the mouse off the control and back on. Given that, I created a simple form with a trackbar, a label and a timer. Below is the code …

Member Avatar for Momerath
0
1K
Member Avatar for Momerath

When Microsoft was developing Windows Vista (and they continued this in Windows 7) they decided to add a security feature to the Program Files directories. This feature is that all the directories are read only. The idea behind this is to prevent malicious software from overwriting your exe/dll files. This, …

Member Avatar for Ssyxz
2
737
Member Avatar for arsheena.alam

Just FYI, having [code]using (Type variable = something that implements IDisposable) { // code here }[/code] Is translated by the compiler into[code]Type variable = something that implements IDisposable; try { // code here } finally { if (variable.Disposed == false) { variable.Dispose(); } }[/code]

Member Avatar for arsheena.alam
0
2K
Member Avatar for vishalonne

Line 62: OleDB doesn't allow named paramters. Replace '@photo' with a question mark '?'.

Member Avatar for Momerath
0
134
Member Avatar for arsheena.alam

It's a requirement of the language itself that base classes must be at least as accessable as classes derived from them. This means if you wish a public child class, the parent class must be public also. You can write a class that contains your base class (has an instance …

Member Avatar for lolafuertes
0
462
Member Avatar for rnbaker

You need to set the update command in the DataAdapter: [code]... Dim mCB A New OleDb.OleDbCommandBuilder(mDA); mDA.UpdateCommand = mCB.GetUpdateCommand(); mDA.Update(mDS, "temp_data");[/code]

Member Avatar for Momerath
0
216
Member Avatar for SolidSora

Line 47 of your sort code should be [icode]numbers(x) = numbers(x + 1)[/icode] and line 49 should be [icode]numbers(x + 1) = temp[/icode]

Member Avatar for Momerath
0
632

The End.