Jump to content
Xtreme .Net Talk

FlyBoy

Avatar/Signature
  • Posts

    106
  • Joined

  • Last visited

Everything posted by FlyBoy

  1. im getting this error when im trying to install the SQL Server 2000 desktop engine.....: "a SA strong password is required...." im just want to work with an SQL using C#...dunno what to do....i following a book as an instructor ..its says that i have to have "Microsoft SQL Server 2000 Desktop Engine". so what should i do????? :confused: :o
  2. yes abit....10x. but still i cant figure out,where the events gets theire values from? i mean....if the password validation method returns false or true i dont see it assigning anything to any of the events.... this is the password checking method...: private bool userNameAndPasswordAreValid(string name, string password) { return password.Equals("TrustMe"); }
  3. use the items.add like this comboBox1.Items.Add("Tokyo");
  4. i have the following code,which creates a user control (created it using a book...that doesnt explain it.. :( ) . . . public event System.EventHandler LoginSuccess; public event System.EventHandler LoginFail; . . . private void loginClick(object sender, System.EventArgs e) { if (userNameText.Text.Length == 0) { loginError.SetError(userNameText, "Please enter a user name"); return; } if (passwordText.Text.Length == 0) { loginError.SetError(passwordText, "Please enter a password"); return; } if (userNameAndPasswordAreValid(userNameText.Text, passwordText.Text)) { if (LoginSuccess != null) { LoginSuccess(this, new System.EventArgs()); } } else { if (LoginFail != null) { LoginFail(this, new System.EventArgs()); } } } i cant figure the events : "LoginSuccess" and "LoginSuccess". where do they get info from that they can be cheacked for a null value??? :confused: 10x in advance.
  5. hi all! is there anyway to connect, i mean to work with external instuments using c#?? (like if i want to build something that will turn on a light that is connected to a USB port....or to connected to the COM1\2\ or Parrallel???) 10x in advance. p.s: i dont want to know,i just want to know if its possible.
  6. ohh now i see!!! i forgot the constructor......thanks for the help! ;)
  7. GOT IT! thanks...(saved it to doc..like every reply i get..(-: )
  8. i cant figure out...what's wrong in this code: static void Main(string[] args) { YYY t = new YYY(); t.I =10; YYY f = new YYY(); f.I =50; YYY c; c=t+f; } } public class YYY { public int I { get { return i; } set {i=value; } } private int i; public static YYY operator+(YYY a,YYY b) { YYY z = new YYY(a.I + a.I); return z; } } it gives the following Error:"No overload for method 'YYY' takes '1' arguments" :confused: :confused: :o
  9. yep..thats right,me again..i hope that im not making you nervous or something with my question,im just a c# newbie :o (for now...hehe :) ). this time,i have a question regarded to "Operators overloading". i've snooped abit at this code (from MSDN..) : using System; public struct Complex { public int real; public int imaginary; public Complex(int real, int imaginary) { this.real = real; this.imaginary = imaginary; } // Declare which operator to overload (+), the types // that can be added (two Complex objects), and the // return type (Complex): public static Complex operator +(Complex c1, Complex c2) { return new Complex(c1.real + c2.real, c1.imaginary + c2.imaginary); } // Override the ToString method to display an complex number in the suitable format: public override string ToString() { return(String.Format("{0} + {1}i", real, imaginary)); } public static void Main() { Complex num1 = new Complex(2,3); Complex num2 = new Complex(3,4); // Add two Complex objects (num1 and num2) through the // overloaded plus operator: Complex sum = num1 + num2; // Print the numbers and the sum using the overriden ToString method: Console.WriteLine("First complex number: {0}",num1); Console.WriteLine("Second complex number: {0}",num2); Console.WriteLine("The sum of the two numbers: {0}",sum); } } my question is as follows..: in all the example i've seen so far about OO (operators overloading...) i've seen that the overloading method (...or whatever it called) used parameters of the costructor type...hmm..is this necessery? i really (yet..) dont understad it that good.... 10x in advance.
  10. FlyBoy

    Events?

    AWESOM!!!! thank you very much!!!!!! ;) eventually i dont think i gonna use events that much,i dont see (..yet) any use for them,that i cant do with delegates. basically both of them (events and delegates) are method\indexers .... pointers..(am i right??) :confused:
  11. FlyBoy

    Events?

    ok,i got the idea of delegates,which are pointers to methods\functions... but whay do i need events???? i mean i cant unerstand it that good...any idea how do understand it????? looks on google...read msdn,and alot of more tutorials,but most of them arent that clear and understandable... :o :confused:
  12. anyone knows good books for begining with C# mobile apps? i already know asp.net
  13. is there anyway (just for knowledge....) to create mobile apps with c# (like with java for e.g)????? and what is the Asp Mobile.Net thing?
  14. oh. now i understand it...10x alot !!!!!!
  15. now i see...thank u very much!!! and i have another little question,i cant figure out what the "?" is doing there...couldnt really understand the syntax: get { int i = Array.IndexOf(phoneNumbers, number); return (i != -1) ? names : new Name(); }
  16. i want to create an int indexer...this is the code: public class Ctest { public Ctest(int len) { i=len; } public int this[int i2] { get {return i;} set {i=value;} } private int i; } public void main() { Ctest tt= new Ctest(5); } the problem is..that its aint really creatin an array....when i assign a value to a specific index in the indexer...it applies it to all the indexer(array) for e.g: tt[0]=10; if i'll do this: Console.Writeline(tt[1].tostring()); it would produce the same value that is in tt[0]. any idea??? (im pretty new with indexes)
  17. u might find some nice open sources at : http://www.sourceforge.net
  18. thats why im using error catch handlers.... this mathod called Casting right? (never figured what is the diffrence bwtween this,and the method i've tried.) :o
  19. i have the following code,which im trying (for educational purposes only) convert an object type to int...this is the code: class test { public test(object obj) { int tmp; try { tmp=Int32.Parse(obj);; x=tmp; } catch (System.Exception ex) { } } . . . . . . it doesnt work..tried also : int.prase(obj). and still didnt work...any idea?
  20. hey...i would like to know what are the uses of the static keyword when using it with properties.... when using it on class or structs , i know that i dont need to initialise the class or struct to use the static method....but when it comes to properties....i have no idea. any explanation would be great... 10x in advance
  21. FlyBoy

    Interfaces?

    many thanks! im printing your replies...of all of you...they really help me!!! and btw,the idea of implementing an interface in multipile classes is pressty weired,i guess,because the interface has to include all the classes methods that thats its implementing and then it makes him pretty big isnt it??? for e.g: interface ICars { string Color(string c); int void CarModel(); float Acceleration(string m); } The classes that inherits from it: class Ford : ICars { string Color(string c); { . . } int void CarModel(); { . . . } float Acceleration(string m); { . . . } Lets say that there is another class that contains only one method from the ICars,so in this case i would be still able to use the interface on it?
  22. thanks folks... any suggestion on a good C# book about OOP?
  23. do i need these both if im not using duplicated method names??? since i really didnt undertand them...yet :o p.s : im studying from a book,and before every question that i post here,im looking in MSDN or google for an answer...but in this case, and maybe more to come...to no avail :o
  24. FlyBoy

    Interfaces?

    awesom examples! thanksss!!!!! many thanks ...!!! this OOP makes a bit difficults for a new c#\c++ programmer....but its a basic key and i have to understand this.
  25. i didnt understand why do i need interfaces. they areant implementing anything. only the method names... and if im not wrong i can use a specific interface only on a class where the method names are the same as in the interface. so a specifict interface fits only for a specific class.... :-\ why do i need it????????
×
×
  • Create New...