1,443 Posted Topics
Re: Have you created the GroceryItemOrder class yet? [B]I[/B] would do that first. | |
Re: 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; … | |
Re: 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 … | |
Re: [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 … | |
Re: 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 … | |
Re: 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 … | |
![]() | Re: 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]. |
Re: 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). | |
Re: 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? | |
Re: How are you going to use it? Is this just a proof-of-concept? | |
Re: ...good way to make a virus or malware | |
Re: Have you looked into the IDataReader types, such as OdbcDataReader? | |
Re: 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] | |
| |
Re: 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? | |
Re: 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; … | |
Re: It depends. If this is on Windows (and dot net), you can reach the ->Text property of your textbox. like: Form1->TextBox1->Text = "hey"; | |
Re: ...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> { … | |
Re: Are you still getting the error? Why do you think it's a problem with Linq? | |
Re: Do you want a combination of all of the columns? | |
Re: 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] | |
Re: 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 … | |
Re: I'm a little confused. abc is NOT greater than pqr. | |
Re: 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. | |
Re: What about using TTimeSpan? | |
Re: Did you compile it? What type of project was it? | |
Re: If you create a delay between the copy functions, does it work? | |
Re: Well, the first thing I would do would be to put some [B]code[/B] in it ;) | |
Re: 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. | |
Re: 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. | |
Re: 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. | |
Re: [url]http://www.daniweb.com/software-development/cpp/threads/148370[/url] | |
Re: 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 … | |
Re: ...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] | |
Re: Did you try using them? If you have access to a compiler or Debug, you can test the theory. | |
Re: 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 … | |
Re: 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] | |
Re: 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. | |
Re: 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 = … | |
Re: 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. | |
Re: If you are doing this in Windows 7 or Vista, did you start the command prompt as administrator? | |
Re: This can also be done as a Console Application. Do you currently program? I'm just trying to clarify where this should start. | |
Re: 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 = … | |
Re: Your main() will need to received those arguments, first. | |
Re: ...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 … | |
![]() | Re: 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] |
|
The End.