|
The answer to this question would be huge. There are quite a few articles available on how to make client server applications for chat etc. Maybe you should consider doing some research on your own before asking?
|
|
|
|
|
is it a bad thing inside a catch block within a while block? an example would be a catch block that skips a counter++ line if it encounters bad data.
TIA!
I am a SysAdmin, I battle my own daemons.
|
|
|
|
|
I don't see why, although I'd do the ++ at the end of teh try, and then it gets skipped by the catch
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thanks. if i widen my try{} block though to include the counter++ i would be including more code than i should? (i.e. i only want to catch exception from the current code block.
I am a SysAdmin, I battle my own daemons.
|
|
|
|
|
The try is to protect that other code too; it means "I want to do these things, but not of there's a problem."
So, yeah, putting a continue in a catch is likely to be poor style.
Do it if a really need to, but it should not be your usual tactic.
In the case described, it's simpler to put the increment in the try rather than after.
|
|
|
|
|
It should be ok. I often find that it takes some extra time to catch an error rather than checking the data by other means. This means that if errors are frequent you might be better off checking the data for errors rather than relying on error catching.
|
|
|
|
|
thanks, it is for rare exceptional data. cheers!
I am a SysAdmin, I battle my own daemons.
|
|
|
|
|
im a computer science student, i want to write a program on video conferencing using c# and my C# programming level is very basic. I would like to know if its possible to finish it in a month and i would also like to know what C# topics i should be reading and what other resources i might need for the program.
|
|
|
|
|
Start here[^].
I suspect if you want to write a video conferencing program, you don't know much C#, and you don't know how to do any research, the answer to your question is no, sorry.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi i have one doubt regarding creating a object. i refer in google and asked about this from my friends. But i didn't get clear answer from all these sources. I need exact difference between these two. Please can any one can help on this. Dont treat this as a basic question. But it doesn't have exact answers any where.
I have one class name as Employees. Now i want to create an object for this class. what is the difference between the below two?
1. Employees obj;
2. Employees obj = new Employees()
G. Satish
|
|
|
|
|
I answered this question days ago. If you didn't understand the answer, then you should have asked a further question. Either way, the fact that you would ask this at all, and that you can't work out hte answer from your books, or from google, is a fair indication that you are very, very lost, and should not be writing any code that anyone is paying for, or considering buying anything but the most basic of books, if you are serious about reaching a level of being able to write actual, commercial quality code.
This is not an attack, it's the best advice I can give you. Slow down and learn some absolute basics, because you're obviously not at a stage where you know enough to ask questions here and expect to understand the replies.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi
first one will not assign memory
Second one will
*** Why EXPERTS behave like a fool ***
|
|
|
|
|
I told him this the other day, he did not reply, and just asked again.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Dot_NET Dude wrote: first one will not assign memory
Second one will
I have a question on this, if you answer ?
When we create like
a) Employee emp;
here we cant use all methods or properties of employee class.
but when we create like
b) Employee emp = new Employee();
then, can use all methods & properties.
I had found this behaviour.
So, my question is if we cant use all methods by creating
Employee emp;
then what is the use of it?
|
|
|
|
|
The core answer here is that you have significant gaps in your most basic, elementary knowledge and need to be reading a basic book, so that you can establish some fundamentals. Please do that.
As I answered satish before, although sadly he never responds, he just fails to understand and yet decides to ask again ( which means he will never learn ), Employee emp does not create an employee at all. It creates the space to hold an employee. It's really a shorthand for Employee emp = null; What use is it ? Well, one obvious thing is that one may do this in code:
private Employee _employee = null;
public Employee CurrentEmployee
{
get
{
if (_employee == null)
{
employee = LoadEmployee();
}
return _employee;
}
}
This is called lazy initialisation. This means the program doesn't pay the cost of creating this employee, until it needs it, but then it only pays the price once.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
So the point is to hold until you are not force to create the object.
well thanks a lot for replying sir.
One thing i want to share while reading the books, i just go thru it and get/mug up what is immediate required.
It comes to concern only when i really trying to dry run the code.
Means the application is finished and working, now lets see how i had done this.
|
|
|
|
|
Hi all,
Is there any way to get current weeks detail frm the database using SQL 2000??
For e.g. today is wednesday, i want all data from monday to sunday.
Plz can anyone help in this
--Here 2 See Sharp--
I have not failed. I've just found 10,000 ways that won't work.
|
|
|
|
|
Haven't tried it, but I pasted this from a google search:
SELECT * FROM YourTable
WHERE DATEPART(WK, YourDateColumn) = DATEPART(WK, GETDATE())
Don't know if you can adjust what the starting/ending days are or not. Might ask in the SQL forum.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
thanks a lot steve...
this piece of code has made my things so simple....
it works like a charm....
--Naina
--Here 2 See Sharp--
I have not failed. I've just found 10,000 ways that won't work.
|
|
|
|
|
Hi ,
how can we print a windows form in C# using print document control .....,
im not getting how to assign printdocument1.document= form();
thanks .
|
|
|
|
|
Hello,
You may take a snapshot of Form using PrintToBitmap function of Form.
Following is a code snippet to do so-
---------------
bmp = new Bitmap(this.ClientRectangle.Width, this.ClientRectangle.Height);
this.DrawToBitmap(bmp, new Rectangle(this.ClientRectangle.X, this.ClientRectangle.Y, this.ClientRectangle.Width, this.ClientRectangle.Height));
this.PictureBox2.Image = bmp;
---------------
If you want to print this data then you will need to add one PrintDocument object, like this-
Dim WithEvents pdoc As New System.Drawing.Printing.PrintDocument
Add code in PrintPage Event of PrintDocument object –
e.Graphics.DrawImage(bmp, this.ClientRectangle.X, this.ClientRectangle.Y);
Then you may get it printed by simply using a line of code-
pdoc.Print();
This would print the picture of the form.
I hope this helps.
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
HI ,
Thanks for u r reply , what im trying is , ihave a form containg textboxes and labels , i want to print that form as it is .
can you tell me how can i do this .............
|
|
|
|
|
I have already informed you, take image of form in a bitmap object usign DrawToBitmap function, and print this form using PrintDocument control.
If you want to print only some of the controls, use DrawToBitmap function of those controls to draw them in different bitmap objects, because every control comes with this method.
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
OK , Thank you i will try
|
|
|
|
|