|
You might log the offending INSERT INTO commands and see what is wrong.
Are spaces relevant ?
Luc Pattyn
|
|
|
|
|
I tried doing so but the same error occurs!
Regards,
Butterfly
|
|
|
|
|
Butterfly_h wrote: ("INSERT INTO Accessories (accessory-type, accessory-price)" + "VALUES('" + x + "','" + y + "')",
try using the escape char with your single quotes... for example "VALUES(\'" + x + "\', \'" + y + \'")
are x, y and the relevant db columns of the same data type?
|
|
|
|
|
yes they are.
If you can go through the code I have three tables each has the same insert statement but it only works with the Material table.
I'll try your suggestion and tell you what happens.
Regards,
Butterfly
|
|
|
|
|
I once more suggest you list the three actual INSERT lines (on 3 consecutive lines!),
and I am confident you will spot the problem.
Luc Pattyn
|
|
|
|
|
I tried it and it still not working!
Please if anyone figures it out to tell me.
Regards,
Butterfly
|
|
|
|
|
Hello again,
I got the solution to my error and it was in the columns names in both Material and Accessories tables.
I should have used [,] with the column names containing -.
Thanks for your responses.
Regards,
Butterfly
|
|
|
|
|
hi
i want to set password on my exe file,i know that i run this operate via Executable header but i don't found an article that use executable header in c#.
anybody can help me >?
thanks
|
|
|
|
|
Eh? Can you explain more clearly.
Do you want to ask the user for a password when they run the program?
If so then just add a password dialog before anything else in your main routine.
Or are you trying to encrypt the contents of the executable?
I have no idea what I just said. But my intentions were sincere.
Poore Design
|
|
|
|
|
hi,
please can anyone tell me the main difference b/w Read-only variable & Constant variable??
thanks,
Rahi
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Citing MSDN: "The readonly keyword is different from the const keyword. A const field can only be initialized at the declaration of the field. A readonly field can be initialized either at the declaration or in a constructor. Therefore, readonly fields can have different values depending on the constructor used. Also, while a const field is a compile-time constant, the readonly field can be used for runtime constants" (readonly (C# Reference)[^])
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
readonly is evaluated at runtime, const is evaluated at compile time. So, if you use a const value from one dll in another, you need to redistribute both dlls if the value changes. If it's read only, you need only replace the dll that changes the value.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Also, you can have a const value type, but not a const reference type (except for System.String). Readonly can be either value or reference type objects.
:josh:
My WPF Blog[ ^]
We are what we repeatedly do. Excellence then, is not an act, but a habit. - Aristotle
|
|
|
|
|
|
Thanks to all who answered my question. now i came to know what is the difference b/w read-only & a constant.
Thanks,
Rahi
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
I hope this is an easy one. It seems like it should be.
I have a pictureBox that I am using as a button. I'm swapping images in and out for up and down states. When the user clicks and holds the mouse down I want it to execute the MouseDown code multiple times until they MouseUp.
<br />
private void mirrorAdjust_MouseDown(object sender, MouseEventArgs e)<br />
{<br />
mirrorPictureBox.Image = Resources.MirrorDown;<br />
<br />
FunctionToRepeatUntilMouseUp();<br />
}<br />
<br />
private void mirrorAdjust_MouseUp(object sender, MouseEventArgs e)<br />
{<br />
mirrorPictureBox.Image = Resources.MirrorUp;<br />
}<br />
|
|
|
|
|
Hello,
In this case you have to work with a timer. (System.Windows.Forms.Timer for example)
You set the Enable Property true at Mouse Down.
In the tick event code you than add the mousedown code.
At mouse up you have to set Enable to false. (Also at MouseLeave to be sure)
Hope that helps,
All the best
Martin
|
|
|
|
|
Thanks for the quick reply!
Sounds good I will use a Timer then..
Thanks
-Kevin
|
|
|
|
|
I have not done this, but I expect you can use a regular Button, give it no text,
but add a picturebox to its Controls property, hence combining the best of both.
Luc Pattyn
|
|
|
|
|
I'm writing a form based app using the tab control. I want to make the app as modular as possible so it will be easy to modify and extend.
My intention is to subclass TabPage and design each tab separately so it can be "plugged in" to the main app (at compile time, not run time). Ideally, my subclassed TabPage would be usable in the form designer to lay out the controls for that tab.
In practice, however, I'm finding that form designer will not display my subclassed TabPage in design view, it will only show me the controls present on the page as icon view. My question is this: Is there any way to make my subclassed TabPage show up in form designer the way I want?
Thanks,
Trent R
|
|
|
|
|
One solution would be to use a UserControl / Panel which would allow you to lay out the controls as you want.
You could then either load this custom control onto a tab page, or you could simply change the inherited class from UserControl to TabPage, hopefully the layout logic that was generated by the designer will remain there (it might disappear though if you try and re-load it into the designer).
The safest would probably be to use a UserControl as the "subclassed" TabPage and then simply drop this onto an existing tab page.
I have no idea what I just said. But my intentions were sincere.
Poore Design
|
|
|
|
|
|
Hello,
I think the error you made, is choosing this FilterTextBox!
There are much better articles here on CP.
After a quick search I found code like:
this.SelectionStart = p-1;
Without any validation before.
So really I think the error comes from the Control youre usercontrols inherit from.
P.S.: You should use double.TryParse instead of Convert.ToDouble.
All the best,
Martin
|
|
|
|
|
Hmm... yeah, there are a few... Which do you recommend? I don't wanna choose a bad one again... Thanks!
Windows Calculator told me I will die at 28.
|
|
|
|
|