|
Here we go, changed it all to work with arrays.
<br />
static void Main(string[] args)<br />
{<br />
int[] Numbers = new int[3];<br />
int[] sum = new int[1];<br />
<br />
Console.Write("Please enter the first integer: ");<br />
Numbers[0] = Convert.ToInt16(Console.ReadLine());<br />
<br />
Console.Write("\nPlease enter the second integer: ");<br />
Numbers[1] = Convert.ToInt16(Console.ReadLine());<br />
<br />
Console.Write("\nPlease enter the third integer: ");<br />
Numbers[2] = Convert.ToInt16(Console.ReadLine());<br />
<br />
for (int i = 0; i < Numbers.Length; i++)<br />
sum[0] += Numbers[i];<br />
<br />
Console.WriteLine("\nThe sum is {0}.", sum[0]);<br />
<br />
Console.ReadKey();<br />
}<br />
|
|
|
|
|
ProdigiSA,
You just did someones homework for them
Regards,
Gareth.
|
|
|
|
|
Wewps
|
|
|
|
|
How do you find an average of three numbers .
|
|
|
|
|
|
I'm only in 8th grade and I'm learning C# by myself. So shut up if you do not know.
|
|
|
|
|
Better u can use arraylist and solve this issue.
otherwise u can define the int array and size.
Continue...
|
|
|
|
|
Pfft... recursion is the way to go here. All classroom assignments require recursion.
|
|
|
|
|
Hi,
This is my interface
DataTable FindAll();<br />
implementation is
<br />
public DataTable FindAll()<br />
{ String query = "SELECT * FROM Media";<br />
DataTable dt = util.DatabaseManager.ExecuteQuery(ConnectionString, query, "outdoordata");<br />
if (dt.Rows.Count == 0)<br />
{<br />
return null;<br />
}<br />
return new media(dt.rows[0]);------it is showing error "cannot implicitly convert media to system.data.datatable.<br />
}<br /> Here is media is class which done the following
<br />
public class media<br />
{<br />
public Media(DataRow dr)<br />
{<br />
if (dr["media_type_id"] != DBNull.Value)<br />
{<br />
this.media_type_id = Int32.Parse(dr["media_type_id"].ToString());<br />
}<br />
if (dr["description"] != DBNull.Value)<br />
{<br />
this.description = dr["description"].ToString();<br />
}<br />
if (dr["width"] != DBNull.Value)<br />
{<br />
this.width = Double.Parse(dr["width"].ToString());<br />
}<br />
<br />
}<br /> It is giving error is "cannot implicitly convert media to system.data.datable
murali krishna
|
|
|
|
|
Your function's signature is DataTable FindAll() , therefore it should return a DataTable object and not a Media one
Change the return type to Media .
SkyWalker
|
|
|
|
|
Hi I am using firebird database using C#.Net.I am unable to connect firebird db windows application and windows service, at a time only one application is working with fire bird db.
Please help me how to connect firebird db from two applicatins like windows application(Desk Top)and windows service.
|
|
|
|
|
Hello,
I am using listview to add, delete and update items. Updation is done every 100ms and there is a lot of flickering. I used BeginUpdate() and Endupdate() while removing and inserting new row. The flickering reduces when the application is run on Windows 2000 but not on Windows XP, Any idea?
Thanks,
Sushma
|
|
|
|
|
YourControl.SuspendLayout()
... do something ...
YourControl.ResumeLayout()
SkyWalker
|
|
|
|
|
Thanks... I tried it out but there was no difference in flickering
|
|
|
|
|
If this is a windows form, then you may need to set the form for double buffering. A search here or on the web will show you how.
|
|
|
|
|
|
Your C# program is going to try and access the fortran code via COM. So your Fortran code has to expose the COM interface in order for C# to properly communicate with it.
|
|
|
|
|
thanks for your reply, your advice may be a pretty good solution, but for me that's a little tough, I have no idea of Com.Anyway, thanks a lot.
|
|
|
|
|
Is the FORTRAN program developed within the .NET environment?
If not, how is the FORTRAN written? That tool may have an option to expose the FORTRAN to COM aS part of the build process.
|
|
|
|
|
hi friend im using vs2005.how can i add AjaxContolToolkit to my web application?
Hi,Im Razana
|
|
|
|
|
razanabanu wrote: hi friend im using vs2005.how can i add AjaxContolToolkit to my web application?
1 - You have chosen wrong forum. Post it in ASP.NET forums.
2 - Use google to find this, There are tons of articles explaining how to add it,
|
|
|
|
|
I'm curious as to the discrepancy between your subject and your question. They should have a better (more concrete) relationship.
|
|
|
|
|
hello frnds,
i am using C#.Net 2.0 window based application.
i want to disable Windows close button.
how can do that ???
any API ???
please help.
thankx in advance
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
Hi,
You can use FormClosing event for disable the close button.
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
}
Please let me know if this help you.
Thanks,
Gopal.S
Gopal.S
|
|
|
|
|
You need PInvoke for that. Check this[^]
|
|
|
|