Jump to content
Xtreme .Net Talk

HSN

Members
  • Posts

    23
  • Joined

  • Last visited

Everything posted by HSN

  1. In fact I haven't installed the ODBC. I'll try to install it now.
  2. Here is my procedure for connecting to mysql: internal void mySQL() { string mySQLString = "DRIVER={MySQL};DATABASE=system;"; mySQLString += "SERVER=localhost;"; mySQLString += "UID=root;PWD=1234;"; System.Data.Odbc.OdbcConnection myDb = new OdbcConnection(mySQLString); try { myDb.Open(); } catch (System.Exception E) { MessageBox.Show(E.ToString()); } } while I get the following exception: ERROR [iM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
  3. Hiii there, I have never programmed a windows app which uses a db system. I'm a php + mySQL developer and I currently have a database on mySQL. I just wanna use this db using a C# program. Please give me the starting key for that. Thx
  4. Hello, I'm developing a dialog based C# 2.0 application. My dialog has some buttons on it. I need to handle some "keyPress" events on my dialog such that each time for example key 1 was pressed, a certain action is taken. But, when I defined the event handler I found it not wokring. The problem was that the focus is on buttons not on the dialog and the handler belongs to my dialog. To solve the problem I used: this.Focus(); But didn't work! How can keep the focus always on my dialog such that I can handle the key event. Or is there any other solution that lets me use the key handler? Thx
  5. Hello, In part of my application which is written in C#, I want to connect it to a symbian phone via a bluetooth device. So, what are the API's I can use for this purpose and for any other interconnection between .NET and mobile phones? Thanks :)
  6. Hello, How can I terminate a thread say T1 by another thread which I already started say T2? Or in general how can I control one thread using other threads?
  7. Oh, that was really helpfull. Thank you for your assistant.
  8. Yes in fact my problem was that I wasn't set the KeyPreview property to true. Now it works fine. But, how can I determine which key was pressed? Because, according to the key I have to take the appropriate action.
  9. Hello, I need to handle some key press events in a C# windows application. I thought I can use this: [size=2][/size][size=2][color=#0000ff]private[/color][/size][size=2] [/size][size=2][color=#0000ff]void[/color][/size][size=2] MainForm_KeyPress([/size][size=2][color=#0000ff]object[/color][/size][size=2] sender, System.Windows.Forms.KeyPressEventArgs e) { MessageBox.Show("Hello!"); } [/size] But it didn't work! It should output a hello whenever I press a key but it doesn't do anything! Can anyone help me please?
  10. Ok good, that works. But anyway how can I get the system's time?
  11. I'm using the System.Random of C# to generate some random numbers. In order to make the seed vary for each execution of the code, I wanna use the CPU time as a seed number so it would make real random numbers. However, I don't know how do I get the time of the CPU in C#?! Please help me with that..
  12. Hello, I have a question regarding the old visual basic 6.0. I have some programs written in 6.0 and still in use. Are they going to be compatible with longhorn or not?!
  13. Console.WriteLine(Math.Pow(8,1/3F)); True, my problem was that 1/3 = 0 because it is an integer. Yes Wile, VB is more flexibile in this but this implicit type conversion causes problems.
  14. Well, I tried it before I put this thread: [size=2]Console.WriteLine(Math.Pow(8, (1/3))); It wouldn't work. I tried pow() in C++ and Math.Pow() in both C# and Java. This trick cannot be applied to these methods. [/size]
  15. Hello, Is there a built in object that calculates the nth root of some number in C#? for example, (x)^(1/3)
  16. HSN

    C# for webpages

    That seems to be really useful. It says that they have developed a compiler for C# on linux! What I was looking for it is there then. ASP.NET libraries are also included as they mentioned.
  17. HSN

    C# for webpages

    Ok thanks. So, if I'm running my web sites on a linux/unix webserver, I can't have C# scripts in my pages... right?
  18. Hello, How would I use C# programs as scipts in webpages? Like using ASP or PHP or JavaScript. What should my web hosting server support in order to use C#? Please give me examples on using a C# program in a webpage. THX
  19. Oh I see.. ok I added you on Yahoo. See you there later.
  20. Thanks skinrock. I have read some tutorials about it in w3schools.com but still its use is not clear for me as well as using of CSS!! I'm trying always to get involved with new technologies to improve my web programming techniques. I have seen a lot of people talking about XML but haven't yet seen any source code which is using it. What I imagine about it is that it can be used as a database.
  21. Hello, I have a book about XML and read some tutorials about it. However, yet I don't know what is the actual application of this language?! What is it made for? Where should I use it? Could anyone give me an application which is using it and where it is specifically used?! Thanks.. :)
  22. HSN

    C#

    oh thanks PlausiblyDamp I just forgot to create the 2d array like that. Thank you very much... :)
  23. HSN

    C#

    Hello, This is my first post in this forum... and I hope that I find the proper answer my question :) I think that I have to talk about my problem right in this forum... anyway my problem is with the following code: I'm a C/C++ programmer and I loop at C# as a C programmer point of you, thus I tried to initialize a 2D array as follows: using System; namespace CSharp_Scanner { class scanner { static int [][] array = { {1,2}, {3,4} }; static void Main(string[] args) { } } } but it tells that: Array initializer can only be used in a variable or a field initializer. So please can anyone help me with initializing my array inside a class...? ;)
×
×
  • Create New...