1,443 Posted Topics

Member Avatar for willleung9

Have you created the GroceryItemOrder class yet? [B]I[/B] would do that first.

Member Avatar for thines01
0
6K
Member Avatar for hszforu

How about: [CODE] foreach (int[] xa in jaggedarray) { foreach (int x in xa) { Console.Write(" " + x); } Console.WriteLine(); } [/CODE] Also, instead of using the number 4 as your upper bounds, you sould use the .Length property of the array element: [CODE] for (int i = 0; …

Member Avatar for hszforu
0
274
Member Avatar for behemothdave

This code is set to always show the user an error message at the bottom. It would be better to evaluate the value as soon as the user enters it and "return" immediately if it's not in the right range. An alternative would be to loop until the program receives …

Member Avatar for thines01
0
190
Member Avatar for mansi sharma

[CODE] Imports System.IO Module Module1 Sub Main(ByVal args As String()) Dim fileIn As New StreamReader(args(0)) Dim strData As String = "" Dim lngCount As Long = 1 While (Not (fileIn.EndOfStream)) strData = fileIn.ReadLine() Console.WriteLine(lngCount & ": " & strData) lngCount = lngCount + 1 End While End Sub End Module …

Member Avatar for thines01
0
5K
Member Avatar for WDrago

If you scan your root windows directory, you will notice multiple csc.exe files each in a directory separated by the particular platform. I would (...have not tested this yet...) use the specific csc.exe found in the \Microsoft.NET\Framework\v2.0.nnnnn\ directory to compile just for Dot Net 2. [minutes later] I just tested …

Member Avatar for WDrago
0
3K
Member Avatar for dsoto

I suggest that you don't try to do the conversion as a Temperature object; just use (some type of) a floating-point container to hold the values as you iterate through your Temperature array. Do the math, then return a new Temperature object. AFTER you've fixed that, I recommend changing your …

Member Avatar for NormR1
0
1K
Member Avatar for Rebecca_t

Whenever the "code" itself does not determine when the routine exits. It could be waiting on user input or the input from another thread or process before it breaks. Here is [URL="http://en.wikipedia.org/wiki/Infinite_loop"]an article[/URL].

Member Avatar for thines01
0
47
Member Avatar for Amiet Mhaske

A [URL="http://en.wikipedia.org/wiki/Dynamic_link_library"]DLL or Dynamic Link Library[/URL] is used to hold routines, classes and resources for programs. They are usually loaded when needed and unloaded when not. The alternative is "static" linking of libraries (like .lib and .obj).

Member Avatar for thines01
0
127
Member Avatar for cppgangster

I don't see where you're calling "new" before accessing the PTHREADPRMS. If you look at this in debug mode, is PTHREADPRMS NULL before the line that crashes?

Member Avatar for cppgangster
0
715
Member Avatar for merjune
Member Avatar for Mirfath
-1
117
Member Avatar for Lemony Lime
Member Avatar for niggz
Member Avatar for CodeAdmiral

You need a [CODE]public static void main(String args[])[/CODE] in your code or a method name to encapsulate that code. This question comes up a lot on DaniWeb: [url]http://www.daniweb.com/search.php?q=factorial[/url] ...and... [url]http://www.daniweb.com/software-development/java/threads/393559[/url]

Member Avatar for thines01
0
254
Member Avatar for C# HELP
Member Avatar for Rass Saee
Member Avatar for newbie14

1) Take out line 1. 2) Use replace "'" with "''" That all depends on the data. Do you have a sample string you're trying to query?

Member Avatar for thines01
0
189
Member Avatar for Ahmed2

How many times do you want it to loop? You can set up a counter to break after that many times... [CODE] #include <iostream> #include <list> using namespace std; int main(void) { list<string> lst_str; lst_str.push_back("once"); lst_str.push_back("upon"); lst_str.push_back("a"); lst_str.push_back("time"); lst_str.push_back("there"); lst_str.push_back("were"); lst_str.push_back("three"); lst_str.push_back("bears"); // list<string>::iterator it = lst_str.begin(); for(int i=0 ;i<4; …

Member Avatar for Schol-R-LEA
0
2K
Member Avatar for NatherLaci
Re: Form

It depends. If this is on Windows (and dot net), you can reach the ->Text property of your textbox. like: Form1->TextBox1->Text = "hey";

Member Avatar for thines01
0
287
Member Avatar for Krstevski

...or combine it all with Linq [CODE] using System; using System.Collections.Generic; using System.Linq; namespace DW_399345 { class Program { private static string LowerOrderedString(string a) { return new string(a.ToLower().OrderBy(s => s).ToArray()); } public static bool ContentMatch(string a, string b) { return LowerOrderedString(a).Equals(LowerOrderedString(b)); } static void Main(string[] args) { new List<string> { …

Member Avatar for thines01
0
163
Member Avatar for kelvin_8188
Member Avatar for omotoyosi
Member Avatar for thines01
-2
117
Member Avatar for Mike Askew
Member Avatar for Netcode

I first cast it to a string, then to a double and it worked: [CODE] using(SqlConnection conn = new SqlConnection(CDB_SqlLister.csb.ToString())) { conn.Open(); string strSQL = "SELECT * from E.dbo.has_money"; using (SqlDataReader rdr = (new SqlCommand(strSQL, conn)).ExecuteReader()) { while (rdr.Read()) { Console.WriteLine(double.Parse(rdr["mnyOne"].ToString())); } rdr.Close(); } conn.Close(); } [/CODE]

Member Avatar for thines01
-1
118
Member Avatar for kelvin_8188

OK. Here's round 2. It includes the solution I stated in [URL="http://www.daniweb.com/software-development/vbnet/threads/398873"]your other post[/URL] as well as a different [B]non-LINQ[/B] solution: [CODE] Imports System.Linq Imports System.Collections.Generic Module Module1 Public Class CTable Public name As String Public points As Integer Public Sub New() name = "" points = 0 End Sub …

Member Avatar for thines01
-1
147
Member Avatar for kelvin_8188
Member Avatar for moone009

You first need to find the files in the first directory and create a list of them. Then loop through the list copying the source files to the destination.

Member Avatar for GeekByChoiCe
0
354
Member Avatar for redrobby02
Member Avatar for alaa sam
Member Avatar for KazenoZ
Member Avatar for mcconnell_34

Well, the first thing I would do would be to put some [B]code[/B] in it ;)

Member Avatar for thines01
0
101
Member Avatar for kavi4u

You can store your connection string in a dll and link it to your program. You would only need to change your main program if the database brand changes.

Member Avatar for thines01
0
189
Member Avatar for Srcee

Database expertise will carry you a long way especially in the business world. LINQ to objects will then change the way you think about programming altogether. Notice: I did NOT say LINQ to SQL or LINQ to entities.

Member Avatar for berniefitz
0
192
Member Avatar for DerrickC

Searching is easy with just the method .Contains() Also, you can use IndexOf(). Of course, the best of all words is to search the thing with Linq. There are a lot of options.

Member Avatar for thines01
0
127
Member Avatar for mazdasa
Member Avatar for WaltP
0
254
Member Avatar for WhosThatGuy

Can you separate your action into a function that only does that one thing? If you are attempting to ensure numbers in an array are all unique, it's easy to do if you're not concerned about the display and only have the function return if a number was found MORE …

Member Avatar for WhosThatGuy
0
183
Member Avatar for Behseini

...or Path.GetFileName(); [CODE] using System; using System.IO; namespace DW_398724 { class Program { static void Main(string[] args) { string strFilepath = "c:/documents and settings/user/directory/sub_director/text.txt"; Console.Write(Path.GetFileName(strFilepath)); // prints text.txt } } } [/CODE]

Member Avatar for Behseini
0
120
Member Avatar for buae2

Did you try using them? If you have access to a compiler or Debug, you can test the theory.

Member Avatar for gusano79
0
189
Member Avatar for mrym

If you have the source code, you can rebuild it with the option of the Unicode character set. If you do not, you can change the calling project to use unicode (instead of MultiByte). If your project has any MFC in it, you will need to change some of your …

Member Avatar for thines01
0
333
Member Avatar for bjigop
Member Avatar for solomon_13000

Do you need to use "{call getAuthentication}"? ...checking... as in: [CODE]cmd.CommandText = "CALL MyProcedure(@MyParam1, @MyParam2);";[/CODE] reference:[url]http://markcordell.blogspot.com/2008/12/calling-mysql-stored-procedures-from-c.html[/url]

Member Avatar for thines01
0
2K
Member Avatar for jacob501

If your flavor of C++ uses an XML parser, it will be a little easier. If you're using dot net C++/CLI, it gets even easier. There is still a fair amount of work to be done. If you're using standard c++, there will be a lot of work to do.

Member Avatar for Warezov
0
213
Member Avatar for pseudorandom21

Another option depending on how you get the data is to use Linq and call distinct on the object that holds the data. If it's something like a List<string> named lst_strData, you can call lst_strData.Distinct(); or pseudo-code [CODE] // GetDataFromSource would return a List<string> or array, etc. List<string> lst_strData = …

Member Avatar for pseudorandom21
0
223
Member Avatar for Thermalnuke

You probably started the project as a WinForms app, but changed the internals to be a console app. I suggest starting over with the right project type. You can copy/paste this existing code into the new project.

Member Avatar for Thermalnuke
0
113
Member Avatar for zekstein

If you are doing this in Windows 7 or Vista, did you start the command prompt as administrator?

Member Avatar for zekstein
0
143
Member Avatar for TurkAlush

This can also be done as a Console Application. Do you currently program? I'm just trying to clarify where this should start.

Member Avatar for TurkAlush
0
1K
Member Avatar for ThomsonGB

After you've finished correcting these errors, I will ask if you're interested in seeing the actual CLR version of the same code which looks like: [CODE] #include "stdafx.h" using namespace System; using namespace System::Collections::Generic; using namespace System::IO; int main(array<System::String ^> ^args) { List<String^>^ lst_strData = gcnew List<String^>(); StreamReader^ fileIn = …

Member Avatar for ThomsonGB
0
508
Member Avatar for desolatebeast
Member Avatar for sam1

...just a string [CODE] string strData = "This string has 5 words"; Console.WriteLine(strData.Replace("5", "five")); [/CODE] or two options: [CODE] using System; using System.Collections.Generic; using System.Linq; namespace DW_398224 { class Program { static void Main(string[] args) { string strData = "This string has 5 words"; Console.WriteLine(strData.Replace("5", "five")); List<string> lst_strData = new …

Member Avatar for thines01
0
95
Member Avatar for cool_intentions

Here's one technique: [CODE] using System.IO; namespace DW_398205 { class Program { static void Main(string[] args) { string strTempFileName = Path.GetTempFileName(); using (StreamWriter fileOut = new StreamWriter(strTempFileName)) { for (int i = 0; i < 100; i++) { fileOut.WriteLine("{0}", i.ToString().PadLeft(8, '0')); } fileOut.Close(); } } } } [/CODE]

Member Avatar for thines01
0
208
Member Avatar for Beginner sarah

The End.