User Profile
Collapse
-
Have you thought that your answer could be "I cannot do it, since there is no implicit conversion from string to int, since strings can contain characters that are not numbers"? -
Do you mean something like:
Code:public class Parent { public Parent(int arg1, int arg2) {...} } public class Child : Parent { public Child(int arg3, int arg4, string arg5) : base(arg3,arg4) {...} }
Leave a comment:
-
I know, I am not allowed to answer these "solve my home work" questions, but..
What do you mean by "static jagged array"? To me, jagged array is an (one dimensional) array, that has arrays as its elements. The element arrays can have different dimensions (i.e. they are jagged). How can you statically decide the jaggedness? Aren't each element created as needed, i.e. dynamically?Leave a comment:
-
What are these "Todays"? Why do you need them on both tables? Does it mean that you keep archive data of product information, i.e. what was price of a product at some todays, or what?Leave a comment:
-
You might like to check uniqid() function; it claims to generate unique strings. If you need to put the patients to some categories, the first argument might come in handy (it is a string that is attached to start of the id).Leave a comment:
-
It depends how you like to use the array. Small search with google gave this page: http://www.oracle.com/technology/sam...ind/index.html where the procedure is called once for each array element (the procedure inserts the values to a table).
I do not know how the array call is implemented, but it might be, that the array is moved as a whole to the server and the server side calls the procedure for...Leave a comment:
-
Yes, you could, but you do not like to. Study SQL injection (for example from http://en.wikipedia.org/wiki/SQL_injection) and use parameterized statements instead.Leave a comment:
-
You did not tell us how you called the constructor, but based on the error message, I assume something like
which means that you are calling the Product constructor with no parameters. However, you do not have parameterless constructor, as the error message tells. Either create one (you can have several constructors with different number or types of parameters) or call the constructor with right parameters, like...Leave a comment:
-
You have also decide if you mean the time on the client or the server. If you are using the time in the client, you should use DateTime in C#, something like
But if you mean server time, you should use
So what is the difference? If the database and client are on the same computer, no much. But if there are several PCs as client, their clock differ somewhat, so it is better to use common clock, and server's...Leave a comment:
-
Guid is a structure, so you cannot pass a null to your method. You either have to create a class that contains the guid as a field, or use Nullable<Guid> as the parameter.Leave a comment:
-
If you use the plain struct, you allow the compiler to put the fields the way it likes. If you know how the data should be (and you seem to, since you know the real size), you should use tell it to the compiler with StructLayout attribute. I have used following when porting C code
Code:[StructLayout(LayoutKind.Explicit)] public struct IDName { [FieldOffset(0)] public ushort Id; [FieldOffset(2)]
Leave a comment:
-
There are two cases where zero comes on "empty table":
1. If table's size is zero:
Code:Type table[] = new Type[0];
2. When table is created, its elements contain default value of the Type. If the Type is numeric value, its default value is zero (either integer zero, floating zero or decimal zero). In a way, this kind of table...Leave a comment:
-
If you know the size of the image beforehand, have you thought on using progress bar (in System.Windows. Forms, the ProgressBar class)? Update it each time you get more of the picture.Leave a comment:
-
It is quite common to use same name for object's instances and parameters in constructors, like
Code:public class Appointment { float duration; string name; DateTime time; public Appointment(string name, DateTime time, float duration) { this.name = name; this.time = time; this.duration = duration; } .. }
Leave a comment:
-
What do you mean by form name? Name property of the Control class or something else? And more important, what do you mean by calling form? Do you mean creating the form, and then sending ShowDialog or is the form already created, but possible hidden?Leave a comment:
-
Because 0.2 cannot be represented exact on floating point, value readed by the compiler and calculated from two double numbers (where 0.8 cannot also be repsesented exact), there has to be some differences.
For online help, check http://www.h-schmidt.net/FloatApplet/IEEE754.html or read wikipedia.Leave a comment:
-
Is everything you receive garbage, or only the end? If the end, you might like to send not only the string, but its length also and use characters up to the length.Leave a comment:
-
The \r\n works on Microsoft's implementation of C#. There are others, that might use \n (for example Mono on Linux). I have started to use Environment.New Line, since it knows what works on the system.Leave a comment:
No activity results to display
Show More
Leave a comment: