291 Posted Topics
Re: the for construct can be looked at like a while construct. Maybe this will help you understand it x=2; num = 100; while ( x < num ) { // do something with x x = x + 1; } Hope that helps. The modulus returns the remainder of the … | |
Re: Barefoot Unfortunately, you are dealing with fileIO and things will get slow. What you can try IMO is saving the information into an xml file, or SQL database. Then the next time you run the program it will load from the data store. Another thing to try is parcing the … | |
Re: Try changing your code to this: [code] OleDbCommand myOleDbCommand_MemCount = myOleDbConnection.CreateCommand(); myOleDbCommand_MemCount.CommandText = "Select COUNT(emp) [B]as empCount[/B] FROM temp_table)"; OleDbDataReader myOleDbDataReader_MemCount = myOleDbCommand_MemCount.ExecuteReader(); if ( myOleDbDataReader_MemCount.Read() ) { Console.WriteLine("Number of Members: " + myOleDbDataReader_MemCount["empCount"].ToString() ); int Count = (int)myOleDbDataReader_MemCountl["empCount"]; Console.WriteLine(Count); myOleDbDataReader_MemCount.Close(); } [/code] You can also just use the 0 … | |
Re: There are a few things for you to look at. Where the databases created using the "sa" administrator account ? IOW, who is the owner of the database, and was the Login account you are using to log in to the server have permission to use the new DB. The … | |
Re: I have attached a project that does what you want. Parameters are passed on the command line. So if you set a File Association with your application, and double click it in the explorer, it will launch you application and pass the filename as a parameter. The example project determines … | |
Re: I am also a convert from Delphi (started with D1, ended with D2005). There are many ideas out there on how to centralize your data. The idea of a Data Module is not as foreign to C# as you might think. After all, a TDataModule is nothing more than a … | |
Re: Once the DataReader is closed, it is a null object. You need to reinitialize it as a new DataReader. stat = new SqlDataReader(); | |
Re: You need to convert the Hex back into an int then convert the into to a char. [code] string sHex = "41"; // same as 'A' [COLOR=green]byte[/COLOR][COLOR=green] newByte = [/COLOR][COLOR=green]byte[/COLOR][COLOR=green].Parse(sHex, System.Globalization.[/COLOR][COLOR=green]NumberStyles[/COLOR][COLOR=green].HexNumber);[/COLOR] [COLOR=green]// newByte now = "65"[/COLOR] [COLOR=green]int i = Convert.ToInt32(newByte.ToString()); // i now = 65[/COLOR] [COLOR=green]Char schar = [COLOR=green]Convert[/COLOR][COLOR=green].ToChar(i);[/COLOR][/COLOR] [COLOR=green][COLOR=green]// … | |
Re: Sounds like another student homework assignment. We get lots of those up here. Anyway, study the modulus operator, and you will discover the answer. | |
Re: I assume what you want to do is trap the Page Down key and use it for navigating the datagridview. The problem in your code is that you are not telling the datagridview that you have aleady handle the key press. Let it know that you have taken care of … | |
Re: First check to see if SQL client tools are installed on the machine (I use the registry), then use teh instructions on the SQL Install DVD or visit MSN for instructions on how to automate an installation of the SQL Express Edition. J | |
Re: Do a Google search on c# Server Socket, and/or get the book "TCP/IP Sockets in C#" by David B Makofske, Michael Donahoo and Kenneth Calvert. This book goes into threading the server and client with lots of examples. | |
Re: ..having trouble with creating a list of arrays in a Class .. Exactly what is the problem you having... You don't know how to make arrays, or is it something else ? J | |
Re: Explore X10 [URL]http://www.15seconds.com/Issue/040413.htm[/URL] | |
Re: If I understand you right, you have some text controls on the form, and you want to iterate through each to look at their text value. Since all of them are already in the controls array, you can just iterate through them. You can rely on the name, or set … | |
Re: You might save yourself some time by using Greatis. I am not affiliated with them, but my company uses their product. [URL]http://www.greatis.com/dotnet/formdes/[/URL] | |
Re: Are you asking how to use a checkbox to determine which formula to apply ? Or... are you asking someone to code your tangent and hyperbolic tangent methods ? | |
Re: This works in VS2005, and should work in 2003 [code] [COLOR=green][COLOR=green]private[/COLOR] [COLOR=green]void[/COLOR] Form1_FormClosing([COLOR=green]object[/COLOR] sender, [COLOR=green]FormClosingEventArgs[/COLOR] e) { e.Cancel = (e.CloseReason == [COLOR=green]CloseReason[/COLOR].UserClosing && [COLOR=green]MessageBox[/COLOR].Show([COLOR=green]"Are you Sure ?"[/COLOR], [COLOR=green]"Close"[/COLOR], [COLOR=green]MessageBoxButtons[/COLOR].YesNo, [COLOR=green]MessageBoxIcon[/COLOR].Question) != [COLOR=green]DialogResult[/COLOR].Yes); } [/COLOR][/code] | |
Re: [URL]http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=155663&SiteID=1[/URL] [URL]http://www.codeproject.com/csharp/JalaliCalendar.asp[/URL] Hope this Helps | |
Re: Namespace declarations do not impact the resulting application. They are used by the pre compiler to locate code addressing during the compile phase. You could preface every object and type in your source code with its namespace, and all you are doing is beating up yourself. The c# compiler examines … | |
Re: There seems to be a lot of gaps in your question, but I will take a stab at it. You have a load Game button and you need player 1 and Player 2 to login. I assume both login on the same form while it is open. Once both players … | |
Re: You need only one loop and the use of the modulus operator. [code] [COLOR=#0000ff]private [/COLOR][COLOR=#0000ff]void[/COLOR][COLOR=#000000] btnGo_Click([/COLOR][COLOR=#0000ff]object[/COLOR][COLOR=#000000] sender, [/COLOR][COLOR=#008080]EventArgs[/COLOR][COLOR=#000000] e)[/COLOR] { txtresult.Clear(); [COLOR=#008000]// TextBox to display results (multiline)[/COLOR] [COLOR=#0000ff]int[/COLOR] result = [COLOR=#008080]Convert[/COLOR].ToInt32( txtNum.Text ); [COLOR=#008000]// textbox to hold value to examine[/COLOR] [COLOR=#0000ff]while[/COLOR] (result != 1) { [COLOR=#0000ff]if[/COLOR] (result % 2 == … | |
Re: Simply place a WebBrowser component on your form then pass it the URL WebBrowser.Url = TextBox1.text; | |
Re: covertx, The str value you are passing to the delegate needs to be done a little differently. Invoke is an eventhandler type. That means it takes Sender and Params as the second argument. just like all other event handlers in c#. Params is an object array (like args). In your … | |
Re: Scru, I think what you are after is Serialization (known as pickling in python). Take a look at this website: [URL]http://blog.kowalczyk.info/kb/serialization-in-c%23.html[/URL] -- Jerry | |
Re: Sorry you are having problems adapting to a new language. I find c# one of the easier ones to learn. Your file spec is looking for current dir\images\playbtn_down.jpg But just what is the current directory ? Is in on the C drive ? D ? You really can't tell from … | |
Re: I think you need to post some code so we can see what you are doing... like how you are instanciating InertItem. --Jerry | |
Re: Scru (me again:) I suggest reading Inside C# by Tom Archer and Andrew Whitechapel from Microsoft Press. Also another good book is Programming C# with Visual Studio .net 2005 by Jeffery Suddeth. I purchased mine through Amazon.com I have a large library of C# books, but these two are my … | |
Re: Another way of trapping the Enter key is by using the form's KeyPreview property set to true. Then on the Form's onKeyPress event do this: [code] procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char); var i:integer; tbOrder:Integer; nextComponent: TComponent; function getControlForNextTabOrder: TComponent; var iThisTab:Integer; n:Integer; begin result := nil; iThistab := ActiveControl.TabOrder; … | |
Re: You can't have SET IDENTITY_INSERT for more than one table at a time per database. This is a Microsoft SQL rule. Second, if you have related two tables through a foreign key constraint, and both are using an Identity Column as their primary key... and the contraint is between these … | |
Re: Hey Shadowwrider, <code> [COLOR=#008080]ArrayList[/COLOR][COLOR=#000000] ar = [/COLOR][COLOR=#0000ff]new [/COLOR][COLOR=#008080]ArrayList[/COLOR][COLOR=#000000]();[/COLOR] [COLOR=#0000ff]object[/COLOR][] myarray = [COLOR=#0000ff]new[/COLOR] [COLOR=#0000ff]object[/COLOR][2]; </code> ArrayList comes from the System.Collection name space. I find it very useful, and will show you how to use the array or arraylist. Above I declare both for your consideration. Notice that for the standard array, … ![]() | |
Re: Put a break point on the line [COLOR=#0000ff]string[/COLOR][COLOR=#008000] store = StoreLocator.LocateNearestStore(3, 7);[/COLOR] [COLOR=#008000]and press F5, press F11 when on this line, and it will take you into your StoreLocator class.LocationNearest method. From there, press F10 to execute to the next line, or F11 when you want to drill into another … | |
Re: If you used the Min and Max methods from Java, then you can use the System.Math.Max and System.Math.Min methods in C# Otherwise create a sortable array, get the first and last elements. Hope that helps, Jerry | |
Re: I think he means parameter not items. Parameters are pased to static methds in the same way that parametes are passed to private , public, etc methods. No special parameter syntax required. | |
Re: Is this what you are Looking for ? [code] [COLOR=#0000ff]using[/COLOR][COLOR=#000000] System;[/COLOR] [COLOR=#0000ff]using[/COLOR][COLOR=#000000] System.Collections.Generic;[/COLOR] [COLOR=#0000ff]using[/COLOR][COLOR=#000000] System.Text;[/COLOR] [COLOR=#0000ff]namespace[/COLOR][COLOR=#000000] Blondee2007.cs[/COLOR] { [COLOR=#0000ff]class[/COLOR] [COLOR=#008080]Program[/COLOR] { [COLOR=#0000ff]static[/COLOR] [COLOR=#0000ff]void[/COLOR] Main([COLOR=#0000ff]string[/COLOR][] args) { [COLOR=#0000ff]int[/COLOR] sales = 0; [COLOR=#0000ff]int[/COLOR][] salesArray = [COLOR=#0000ff]new[/COLOR] [COLOR=#0000ff]int[/COLOR][10]; [COLOR=#0000ff]while[/COLOR] (sales > -1) { [COLOR=#008080]Console[/COLOR].Write([COLOR=#800000]"Enter in the sales for the salesperson (-1 to quit): … | |
Re: Examine the InitializeComponent method of your form. You should find the error in that section of code. once cleaned up, you should be able to see and use the designer again... this is a problem that can popup from time to time. | |
Re: There are many examples on the Net, but I settled for the version on CodeProject by M.Redth. This is a very simplistic example, but a very good starting point. In my own project, I have enhanced Redth's version to Load and Unload on demand, multiple plugins active at the same … | |
Re: You mentioned in your original post that you wanted to just post this text data to a listbox. I took your [inlinecode][COLOR=#0000ff]public string[/COLOR][COLOR=#000000] PblReadFile()[/COLOR][/inlinecode][COLOR=#000000] and changed it to [inlinecode]public void PblReadFile()[/inlinecode] then commented out your [inlinecode] [COLOR=#000000]return sr.ReadLine();[/COLOR][/inlinecode][COLOR=#000000] [COLOR=black]and it populated the listbox just fine.[/COLOR] [COLOR=#000000]Jerry[/COLOR] [/COLOR][/COLOR] | |
Re: Maybe this will shed some light on the subject. I create an array of object[] that is populated by the current row when using the GetValues method of the SQLDataReader. I have a set of constants to identify specif columns from the row, however you can use quoted column names … | |
Re: [code] int iMoney = cbCombo.indexof("money"); if (iMoney > -1 ) { cbCombo.SelectedIndex = iMoney; } [/code] |
The End.