|
Wow. I'm not sure how to help you. There's a lot of information that you want to insert into a small table. Well the syntax for insert goes as follows:
INSERT INTO table_name(colname, colname, colname) VALUES (val, val, val...)
Try asking in SQL forum[^] next time.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
I am having a problem with the RCDATA the square box. It will not run.I will be sure to post this in sql next time. Sorry!
|
|
|
|
|
Hi, I would like to add .avi movie media to an windows forrm. I need to show that the aplication is deleting oor copy files to the user.
I want to use files in ...Microsoft Visual Studio .NET\Common7\Graphics\videos folder in my applications.
How can I do that? I need a control or another thingg?
Thank you!
Luis Ruiz
La realidad no es más que impulsos eléctricos del cerebro - Morpheus
|
|
|
|
|
The simplest way is to customize your toolbox in VS.NET to add the Windows Media Player. Then simply drag that to your form and set the variables.
If you're looking to play an AVI like for a copy dialog, it must have no audio and must not use a compression codec (like DivX or something, since AVI files can really use any codec) and you can encapsulate the Animation Windows Common Control. This requires quite a bit of work.
Surprisingly, it's the only Common Control that's not encapsulated in the .NET BCL. Most of those controls you typically use are just encapsulating the Windows Common Controls to present a consistent user interface (Java defines their controls from the ground-up, which is why - even with the loook-and-feel code - it never really matches the OS).
I've already written such a control but I'm not yet ready to share it. Just know that's its not an easy control to encapsulate and is quite a bit of work. If you're not familiar with the Window APIs, P/Invoke, and marshaling and need an animation control ASAP, just use the Windows Media Player. It's a quick, easy, and common approach for playing audio and video in a Windows Forms application.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
hi............
i`m a new comer to sockets,, i`m trying to develop a small server client chatting application,,, so if any one knows a link to any useful page or e-book.....that will be great
youssef
|
|
|
|
|
Google returns quite a few results for "sockets c# sample". Also search for TcpClient
By the way...
I'm not sure if its applicable in your case but you should give remoting a chance. It's a lot easier to implement IMHO.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
I'm writing a validator that will run in a batch build process.
I cannot find docs as to how to set the return code prior to termination of the application. Anyone know of such an article???
Thx.
There are 10 kinds of people in the world.
Those that read binary...
...and those who don't.
|
|
|
|
|
Either use Environment.Exit(int) or define your entry point with an int return type:
static int Main(string[] args)
{
if (args.Length != 1) return ERROR_INVALID_PARAMETER;
}
const int ERROR_INVALID_PARAMETER = 87;
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Thanks much, Heath.
Michael
There are 10 kinds of people in the world.
Those that read binary...
...and those who don't.
|
|
|
|
|
I have an array of bytes like :
<b0><00><01><b0><01><03><c0><00><b0><00><01><b0><01><03>
I would like to compare if one byte is in the array ( <c0>) an copy at the index of this byte selected to the end of the array
ex :
Select the <c0> and copy it to another array
<b0><00><01><b0><01><03><c0><00><b0><00><01><b0><01><03>
=> result : <c0><00><b0><00><01><b0><01><03>
Best Regards
youssef
|
|
|
|
|
Check the System.Buffer class.
It has a static copy method which you can use.
|
|
|
|
|
If you already have this in a byte[] array, too, you can use Array.Copy (inheritted by your byte[] thanks to hook-ups in the CLR) to pass the start index or even the index into the destination array at which you want to write the new array (the array elements must first exist). This is common throughout the .NET BCL for classes that deal with buffers like this.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
What is the best way to validate dates when entered from a text box? formats can be mmddyy, mdyy mdyyyy etc.. Any code would be helpful..
|
|
|
|
|
I'd recommend using a DateTimePicker control.
For what you want to do, imagine the user types: "122004"
Is it:
* mdyyyy - Jan. 2, 2004
* mmddyy - Dec. 20, 2004
How do you know?
The DateTimePicker control has a masked edit already for entering dates, so use it with its Format property set to short date.
Also, it won't let the user type an invalid date.
-- LusiR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
you da man! Works great.. Our shop is new to all of this and we never thought about this.. Boss is happy.. I did a custom format MM/dd/yyyy.. we wanted to show the month and day as 01/01/2004 instead of 1/ 1/2004..
|
|
|
|
|
house wrote:
you da man!
I'm glad it helped. That control is very powerful (for example, see its Checked property, that although buggy, makes it display a check box) so it's always good to know it.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
house wrote:
What is the best way to validate dates when entered from a text box? formats can be mmddyy, mdyy mdyyyy etc.. Any code would be helpful..
Check out the static method DateTime.Parse . It has a series of overloaded methods that allow you to pass in a IFormatProvider as well as specify any DateTimeStyles flags you prefer.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hello,
I have an MDI child form with a tab control on it, and many controls on each page.
When I open the form, I want to set the focus to a control on the first page. I've tried calling the control's Focus() method at the end of the constructor and in the OnLoad handler and it doesn't work. The focus is always initially on the tab control.
Any ideas?
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
I think I made it work. I'm doing it when a VisibleChanged event arrives, only the first time (after the Load event.)
Any better ideas?
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
I'm getting some unpredictable results when I divide two doubles. Here is an example.
If
double[] a = new double[6]{30.0, 3.0, 0.3, 0.03, 0.003, 0.0003};
double[] b = new double[6]{20.0, 2.0, 0.2, 0.02, 0.002, 0.0002};
then according to C# (.NET?)
a[0] / b[0] = 1.5
a[1] / b[1] = 1.5
a[2] / b[2] = 1.4999999999999998
a[3] / b[3] = 1.5
a[4] / b[4] = 1.5
a[5] / b[5] = 1.4999999999999998
Not a big difference in magnitude but my code also involves rounding the results which really throws things off.
Any help with an explanation and/or solution is greatly appreciated.
|
|
|
|
|
ldself wrote:
Any help with an explanation and/or solution is greatly appreciated.
Check out the Double.Epsilon Field[^], it is explained there. Here is a quick example:
double diff = (double)1/3 - (double).33333;
if(Math.Abs(diff) < Double.Epsilon)
Console.WriteLine("They are equal.");
else
Console.WriteLine("They are not equal.");
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hi there,
The reason why 0.3/0.2 does not give an exact result is the following :
C# (and every other compiler) represents your variables in binary values.
For example:
2 is represented by 10 in binary which stands for (1*2^1 + 0*2^0)
4 100 (1*2^2 + 0*2^1 + 0*2^0)
30 11110 (1*2^4 + 1*2^3 + 1*2^2 + 1*2^1 + 0*2^0)
and so on
for values like 0.3, the binary value is not exact, because it is impossible to represent it exactly with this notation...
0.3 is 0,01001100110011... but the number never ends.
Since a double value is represented with 64 0 and 1, you loose a little precision in your operations. There is no real way to avoid this unfortunatly.
I hope this helps
|
|
|
|
|
h_migneron wrote:
There is no real way to avoid this unfortunatly
Actually there is. Double.Epsilon is a field that is defined to be the smallest postive double greater than zero. The idea is that if you take the absolute value of the difference between the two values you wish to compare and their result is less than Double.Epsilon , they are considered equal.
- Nick Parker My Blog | My Articles
|
|
|
|
|
A question for C# language experts:
If I have a struct that implements IDisposable:
struct C : IDisposable
{
public int clan;
public void Dispose()
{
Console.WriteLine("Disposing");
}
}
And later in the code something like:
using (C s = new C())
{
s.clan = 1;
}
A compiler error is reported:
error CS0131: The left-hand side of an assignment must be a variable, property or indexer
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
The problem lies with the fact that structs cant be safely casted, in this case IDisposable. The compiler will typical generate the following for the 'using' block:
IDisposable o = new C();
try
{
C s = o as C;
}
finally
{
o.Dispose();
}
Anyways, my best guess :p
top secret Download xacc-ide 0.0.3 now! See some screenshots
|
|
|
|