291 Posted Topics

Member Avatar for Questions???

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 …

Member Avatar for Questions???
0
161
Member Avatar for simon_wagstaff
Member Avatar for Barefootsanders

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 …

Member Avatar for JerryShaw
0
128
Member Avatar for tphuynh

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 …

Member Avatar for JerryShaw
0
165
Member Avatar for fishsqzr

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 …

Member Avatar for JerryShaw
0
425
Member Avatar for scru

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 …

Member Avatar for JerryShaw
0
108
Member Avatar for Terry Robinson

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 …

Member Avatar for JerryShaw
0
399
Member Avatar for manjusaharan

Once the DataReader is closed, it is a null object. You need to reinitialize it as a new DataReader. stat = new SqlDataReader();

Member Avatar for JerryShaw
0
109
Member Avatar for manjusaharan

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]// …

Member Avatar for manjusaharan
0
103
Member Avatar for poogles

Sounds like another student homework assignment. We get lots of those up here. Anyway, study the modulus operator, and you will discover the answer.

Member Avatar for Ramy Mahrous
0
84
Member Avatar for faranak

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 …

Member Avatar for JerryShaw
0
224
Member Avatar for chait_anya

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

Member Avatar for JerryShaw
0
85
Member Avatar for bumassjp

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.

Member Avatar for bumassjp
0
117
Member Avatar for g27

..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

Member Avatar for pygmalion
0
92
Member Avatar for khalidmehmood
Member Avatar for khalidmehmood
0
142
Member Avatar for quintoncoert

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 …

Member Avatar for quintoncoert
0
120
Member Avatar for vinayvarghese00

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]

Member Avatar for JerryShaw
0
119
Member Avatar for Armani

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 ?

Member Avatar for sanjayay
0
60
Member Avatar for choudhuryshouvi

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]

Member Avatar for choudhuryshouvi
0
118
Member Avatar for erfanjan

[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

Member Avatar for JerryShaw
0
74
Member Avatar for sandipbhoyar

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 …

Member Avatar for JerryShaw
0
113
Member Avatar for shsh_shah

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 …

Member Avatar for JerryShaw
0
116
Member Avatar for luvuyomaq

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 == …

Member Avatar for JerryShaw
0
136
Member Avatar for Qasim Khawja

Simply place a WebBrowser component on your form then pass it the URL WebBrowser.Url = TextBox1.text;

Member Avatar for jbennet
0
190
Member Avatar for covertx

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 …

Member Avatar for JerryShaw
0
75
Member Avatar for scru

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

Member Avatar for scru
0
358
Member Avatar for scru

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 …

Member Avatar for scru
0
114
Member Avatar for fruce

I think you need to post some code so we can see what you are doing... like how you are instanciating InertItem. --Jerry

Member Avatar for RwCC
0
90
Member Avatar for scru

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 …

Member Avatar for jbennet
0
89
Member Avatar for edouard89

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; …

Member Avatar for radu84
0
103
Member Avatar for csharpa

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 …

Member Avatar for JerryShaw
0
79
Member Avatar for shadowrider

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, …

Member Avatar for iamthwee
-1
539
Member Avatar for Monyet

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 …

Member Avatar for JerryShaw
0
113
Member Avatar for Monyet

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

Member Avatar for JerryShaw
0
110
Member Avatar for Monyet

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.

Member Avatar for Monyet
0
127
Member Avatar for blondie2007

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): …

Member Avatar for blondie2007
0
147
Member Avatar for brainbox

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.

Member Avatar for JerryShaw
0
96
Member Avatar for dfdez

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 …

Member Avatar for JerryShaw
0
88
Member Avatar for bullet102

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]

Member Avatar for JerryShaw
0
163
Member Avatar for newtoocsharp

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 …

Member Avatar for JerryShaw
0
95
Member Avatar for amithasija

[code] int iMoney = cbCombo.indexof("money"); if (iMoney > -1 ) { cbCombo.SelectedIndex = iMoney; } [/code]

Member Avatar for amithasija
0
213

The End.