4,439 Posted Topics

Member Avatar for fiakofi

We don't do homework. We'll help you when you're stuck but you'll need to show some effort first. If you are stuck, post up what code you have done and explain the problem you're having.

Member Avatar for Reverend Jim
-1
213
Member Avatar for Papadick

We don't do homework. We'll help you when you're stuck but you'll need to show some effort first. If you are stuck, post up what code you have done and explain the problem you're having.

Member Avatar for Reverend Jim
-1
247
Member Avatar for Godwin Owusu

We don't do homework. We'll help you when you're stuck but you'll need to show some effort first. If you are stuck, post up what code you have done and explain the problem you're having.

Member Avatar for Reverend Jim
-1
107
Member Avatar for RobertHDD
Member Avatar for happygeek
0
658
Member Avatar for meseek
Member Avatar for Jasdeep11

Hi Jasdeep11 welcome. :) Do it like this: int total = 0; //initialize sum outside the for loop for (int a = 5; a <= 25; a++) { //add variable a every time to the total you already have //and store it again in total total = total + a; …

Member Avatar for ddanbe
0
119
Member Avatar for alz3eem-94

Only one book? Run as hell to the library and consult and study as many books you can about C++ functions. Then try and code ONE function and see if it works. Continue. Your teacher gave you sufficient info.

Member Avatar for iamthwee
0
118
Member Avatar for happygeek
Member Avatar for diafol

I doubt if the [following](http://en.wikipedia.org/wiki/Roses_are_red) will still work.

Member Avatar for joseCRJ
1
548
Member Avatar for Santanu.Das

Started learning it, more than a year ago with reading some books. Installed Python in Visual Studio.I installed version 3. I find it a bit annoying that there is no complete compatibility with older version 2 versions. You will find alot of Python code on the web, but watch out …

Member Avatar for vegaseat
0
274
Member Avatar for fedodedo12345

A good thing is to start by reading [the Rules](https://www.daniweb.com/community/rules)s If you know how to get, let us say the minimum value out of a list of integers with a pencil and paper, then the coding is trivial. If you don't know how to do that, i guess you're in …

Member Avatar for rubberman
0
197
Member Avatar for iamthwee

Currently, in my spare moments, I'm taking a walk through [this](http://shoesrb.com/tutorials/) I must admit I'm a little bit more impressed. It reminds me of an older programming language I loved a lot: [LOGO](http://en.wikipedia.org/wiki/Logo_(programming_language)) It used(among other things) turtle graphics to teach very young childeren the basics of programming. Python still …

Member Avatar for iamthwee
0
502
Member Avatar for 00Gambit
Member Avatar for vegaseat
0
176
Member Avatar for fragrancehello

I used to use another strategy for accessing Excel, see this class: // **************************************************** // // Class to manipulate and work with Excel files in C# // DM 2.2.2009 // // **************************************************** using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; using Excel = Microsoft.Office.Interop.Excel; namespace Peaker { class …

Member Avatar for ddanbe
0
677
Member Avatar for mdev
Member Avatar for mdev

But my boss sad me to associate each row to my object. Is object the datagridview? What do you mean by associate? Datagridview has a property called DataSource, is it that what you want?

Member Avatar for mdev
0
171
Member Avatar for ddanbe

Fill in your birthday in the DateTime structure and get your sign as a string. Get an extra (an element associated whith the sign) via the out parameter thanks to C#! This switch statement uses returns all over the place, so a break staement is not needed.

Member Avatar for ddanbe
0
3K
Member Avatar for Hatem_1

Do you mean a read of the file? Try [ReadAllText](https://msdn.microsoft.com/en-us/library/ms143368(v=vs.110).aspx)

Member Avatar for Hatem_1
0
161
Member Avatar for ddanbe

I'm a great fan of extensions in C#. See also this previous [snippet](https://www.daniweb.com/software-development/csharp/code/467292/squaring-an-integer-with-extensions). Extensions are really simple to use. Start with adding a static class containing static methods. Note the special use of the keyword `this` in the Times extension method. The next code snip is how you could use …

Member Avatar for kplcjl
0
385
Member Avatar for jitendralenka

You can only work with pointers in C#, if you put the code in an unsafe block. Plus, you must mark it also in the build tab of the properties window of your project. Hope it helps.

Member Avatar for ddanbe
0
197
Member Avatar for iamthwee

I could do this even some 10 and more years ago, without writing any code in VS! So what does Shoes make stand out? ![Shoes.png](/attachments/small/1/dbcef5606dc4e409150531560e3fe348.png "align-left")

Member Avatar for iamthwee
1
425
Member Avatar for gbhs

Instead of `scriptfile.Split(New String() {"GO"}, StringSplitOptions.None)`, did you try `scriptfile.Split(New String() {" GO "}, StringSplitOptions.None)`?

Member Avatar for Reverend Jim
0
237
Member Avatar for Derorim

Give that horrible code anyway and tell us what's wrong with it. We wont bite you and we don't laugh at people making mistakes.

Member Avatar for ddanbe
0
184
Member Avatar for ddanbe

I have this code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; namespace RegexTest { class Program { static void Main(string[] args) { string str = "The quick brown fox."; string pat = "fox"; Regex rgx = new Regex(pat, RegexOptions.IgnoreCase); Match matches = rgx.Match(str); Console.ReadKey(); } } } …

Member Avatar for ddanbe
0
257
Member Avatar for phexee
Member Avatar for Pompy

On line 25 you are assuming that named is completely filled. named.Length will be the full length of the string array not the length of the array that is partly filled up.The rest will be null. You can't add null to a ListBox.

Member Avatar for Santanu.Das
0
184
Member Avatar for faridoon.jan.7
Member Avatar for waqasmrd

You are talking to us as if we were watching your computerscreen from over your shoulder.Please explain your problem as clearly as possible.

Member Avatar for waqasmrd
0
143
Member Avatar for ts1989

If you are absolutely sure that DATETIME string always has the same format, yuo could use something like this: const int DateStrLength = 5; string DateTimeStr = "ADateATime"; string DateStr = DateTimeStr.Substring(0, DateStrLength); string TimeStr = DateTimeStr.Substring(DateStrLength, DateTimeStr.Length - DateStrLength); Now DateStr will contain the date part "ADate"and TimeStr will …

Member Avatar for pritaeas
0
251
Member Avatar for sdtechi

Play computer! With a pencil and paper! Go through the factorial function. What value is x? Write down **x = 3** What value is f? Write down **f = 1** What value is i? Write down **i = x = 3** In the for loop the condition i >=1 is …

Member Avatar for Santanu.Das
0
151
Member Avatar for davijhon

Ask [The queen of Daniweb](https://www.daniweb.com/members/1/dani)

Member Avatar for happygeek
0
192
Member Avatar for SurabhiMeeooww
Member Avatar for PulsarScript

It was easier to let the code speak than to explain what needed to be done to correct the code in your while loop: namespace UserInput { class Program { static void Main(string[] args) { const string stop = "exit"; //used List instead of ArrayList List<string> CourseList = new List<string>(); …

Member Avatar for ddanbe
0
169
Member Avatar for ts1989

To get a vaue from a cell in a DGV use: `dataGridView1.Rows[RowIndex].Cells[ColumnIndex].Value;` or `dataGridView1.[ColumnIndex, RowIndex].Value;` Loop through the rows with a for statement and the desired column indexes and you're done.

Member Avatar for ddanbe
0
73
Member Avatar for GianiD

Google is your friend here. [Example](http://www.codeproject.com/Articles/13678/The-DataGridViewPrinter-Class). of many. EDIT: Just realized that it is not VB code in the example I gave you. But believe me you will find plenty of VB examples too.

Member Avatar for Santanu.Das
0
147
Member Avatar for GianiD

Hi GianiD, welcome at Daniweb. Assuming you're using vb.net, google for a course on DB. [Example](http://www.homeandlearn.co.uk/NET/nets12p1.html)

Member Avatar for GianiD
0
270
Member Avatar for Hari om

Try new project, in the dialog that opens, on the left side, you will find "Reporting". Click on it. Now click on Crystal Reports Application.

Member Avatar for ddanbe
0
70
Member Avatar for k030775

Hi k030775 welcome at Daniweb. :) Maybe you overlooked this [short article](http://www.codeproject.com/Articles/15460/C-Image-to-Byte-Array-and-Byte-Array-to-Image-Conv)?

Member Avatar for k030775
0
222
Member Avatar for compulove
Member Avatar for ddanbe
0
211
Member Avatar for hamza.muzaffar.96
Member Avatar for Ghost0s

Could you elaborate on that? Do you mean you have a hexdump you want to edit?

Member Avatar for Ghost0s
0
122
Member Avatar for gangsta gama

I've included a zip with just the bare minimum, but I guess it will show you a mechanism on how to get two forms on speaking terms. Good luck! If still in trouble, just ask.

Member Avatar for ddanbe
0
178
Member Avatar for Smalls

Just running `var resourceNames = Assembly.GetExecutingAssembly().GetManifestResourceNames();` and watching with the debugger gave me this: resourceNames {string[2]} string[] [0] "WindowsFormsApplication3.Properties.Resources.resources" string [1] "WindowsFormsApplication3.Form1.resources" string Hope it helps a bit.

Member Avatar for ddanbe
0
298
Member Avatar for Mahmud_1

Something like this: counter = dataGridView1.CurrentCell.RowIndex; Textbox.text = DataGridView1.Rows(counter).Cells("price1").Value.ToString();

Member Avatar for ddanbe
0
124
Member Avatar for eliamck

Perhaps have a look at this [video](https://www.youtube.com/watch?v=nqC5GKr6yDY). Or you could read this [tutorial article](http://holowczak.com/getting-started-with-microsoft-visual-studio-2010-using-c-tutorial/).

Member Avatar for ddanbe
0
67
Member Avatar for tentrabyte

Is it somehow possible to tell us with what exactly you need help? For example the variable `b` never gets used, the while looks a bit strange etc. but as long as you don't explain more, we can do little but guess what the solution might be.

Member Avatar for dbfud1988
0
656
Member Avatar for rpsr150891

Assembly in .NET has nothing to do with what you would expect reading the word. Read this [MSDN article](https://msdn.microsoft.com/en-us/library/ms973231.aspx).

Member Avatar for ddanbe
0
99
Member Avatar for gangsta gama

Every time you call `Player player1 = new Player();` you get the default values for player1. So if you set the properties for player1 like gender etc. and and you call `Player player1 = new Player();` again in another form(as I understood it that is) you just get a "new" …

Member Avatar for ddanbe
0
144
Member Avatar for ogsirus
Member Avatar for deceptikon
0
335
Member Avatar for Swalih

Line 5 should be `f.open("nameoffile.dat",ios::binary|ios::out);` I guess. | being the bitwise operator.

Member Avatar for Swalih
0
3K

The End.