|
|
Hi all,
I need to delete rows from my db, when the criteria is: older than a
certain date.
Can it be done without an SQL string query?? Using only a DataSet
and/or DataAdapter?
The regular SQL would be: "DELETE FROM EventLog WHERE
EL_TimeStamp<01/08/2006".
But the problem is using the date in C# and Access-database.
Thanks in advance,
Danny
|
|
|
|
|
Have you tried using a parameterized query?
DateTime dt = DateTime.Parse("01/08/2006");
OledbCommand cmd = new OleDbCommand "DELETE FROM EventLog WHERE EL_TimeStamp < ?;", connection);
cmd.Parameters.Add("@p1", OledbType.Date,dt);
cmd.Execute();
|
|
|
|
|
Hello fellow programmers,
I have something in mind which, as far as my knowledge goes, cannot be done.
But I'm writing here to ask for a solution...
I'll start with explaining a class I wrote, named ShapedForm...
ShapedForm inherits from System.Windows.Forms.Form.
It has a built in functionallity to receive a Bitmap object, and change the form's region according to the drawing in the Bitmap, leaving out "transparent pixels".
I've also added a mouse-drag ability, as it's impossible to move the form without a title-bar.
So today I've started coding a new project, where I wanted a shaped button!
My idea was to inherit System.Windows.Forms.Control which, as you all know, is the base class for many controls, and add the above functionallities to it.
The problem comes here...
Is there any way to force the derived classes (i.e. Form, Button, Panel, etc.) to inherit from my ShapedControl instead of the original Control class?
Kind of like overriding an inheritance or something like that...
Again, as far as I know, it cannot be done...
So if you have an alternative method in mind, please share it with me.
Thanks in advance,
Shy.
|
|
|
|
|
You are right, you cannot do that. What I would probably do is design it this way:
I'd create a number of Shaped... classes, e.g. ShapedButton, ShapedPanel, etc. These would inherit from the various based classes (Button, Panel, etc.)
The "Shaped" functionality would go into a separate class of its own that contains the functionality that you need. Then from the various control subclasses you created earlier you would call into the Shaped class.
e.g.
public class ShapedStrategy
{
public void SomeShapedFunctionality(Control shapedControl)
{
}
}
public class ShapedButton : Button
{
private ShapedStrategy shapedStrategy;
public override void OnPaint()
{
shapedStrategy.ShapedPaint(this);
}
}
Hopefully that might give you some ideas.
|
|
|
|
|
Yes... I have thought about it...
But it's kind of annoying to do that with every control...
|
|
|
|
|
Hello, my first post here.
Gonna try and be specific as possible.
Here's the situation. I have a small app with a list View set to Largeicon view.
The problem is it will display the icons on some computers, but not all.
Works fine on my laptop, but not on my desktop... Both computers are running WinXP, all
updates and patchs installed.
So I'm just looking for some pointers on where to start looking for the problem.
I know this sounds vague, but it's the best I can do for the moment.
hope someone has an idea...
Thanks alot
LoneFerret
Cross my heart, smack me dead...stick a lobster on my head.
|
|
|
|
|
Not sure if this will help, because I've never heard of a case exactly like this, but what about the color depths for your desktop and laptop machine?
Could this have anything to do with your problem?
Did you try on a third computer as well?
What kind of graphics card do you have in your desktop pc? Are the drivers up to date?
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Hello again..
Desktop colour depths are both at 32bits,
and the graphic card is a Radeon 9600XT 256.
I guess this is weird eh?
LoneFerret
__________________________________________
Cross my heart, smack me dead...stick a lobster on my head.
|
|
|
|
|
Yes it is.
Sorry, don't have an idea what could cause this. Did you try different color depths for you ImageList?
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Hi!
Just wanted to let you know that I just discovered one of my computers showing the same effect.
I stumbled over it while trying to modify the zone security settings.
The icons you usually see for "My Computer", "Local Intranet" and so on are not being displayed.
I don't know when the effect started or if it's there from the start. My graphics card, unlike yours, is a Nvidia 7900 GTX, so it's pretty unlikely that it's a graphics driver problem...
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
I have several textboxes that I wish to toggle the readonly attribute true/false by the user cliucking a button.
Can this be done in VS2005 and if so, how?
-- modified at 9:34 Saturday 5th August, 2006
Glen Harvy
|
|
|
|
|
Sure. Create an event handler for the button's clck event and inside to the following for each textbox:
this.textBoxXX.ReadOnly = !this.textBoxXX.ReadOnly;
"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
|
|
|
|
|
Thank you.
It's little snippets like these that make life much easier .
Is there a website out there where you can do a search on these things. I hunted for hours without any luck.
Once again, thanks.
Glen Harvy
|
|
|
|
|
How about MSDN ?
You will find everything there.
|
|
|
|
|
|
What is the simplest way to serialize a class into a string?
i.e. something like that:
object o = new Something();
String s = SerializeToString(o);
object o = Deserialize(s);
-- modified at 9:14 Saturday 5th August, 2006: note to self - markup is messageboard specific!
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
Tree<t> in C# || Fold With Us! || sighist
|
|
|
|
|
The SerializeToString method could XML-serialize the class, and the Deserialize method could deserializer it using the XmlSerializer class. The resulting XML document could be read in as a string, thus giving you a string-serialized object.
|
|
|
|
|
How can i change the width of CrytalReport(.rpt) at design time?
Thank
|
|
|
|
|
Hi All,
I have created a class file and compile it ,make it as .dll file
and also created strong name and i just installed it into the GAC.
How to use this assembly in my newly developed class file..
How to accesss the methods in an assembly..?
Thanks
paul
|
|
|
|
|
Your project has a "reference branch in the solution explorer. Right-Click there, and select "Add Reference"
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
Tree<t> in C# || Fold With Us! || sighist
|
|
|
|
|
Thank you..
if i didn't use visual studio for generate class file.
I am using Note pad and compile it in the command line compiler..
In this case how can i use that assembly in my new class
Thanks
Paul
|
|
|
|
|
Hi,
I have a C# windows application. I am also deploying the SQL Express along with my application. When both SQL Express & my application has been installed, in a custom action, i attach my database to that SQL Express,create a login and user account. I also give SYSADMIN role to my created account. At the end, i set the authentication mode of my SQL Express to SQL Server only(i.e. Normal or Standard). Now when i try to connect to that database using my created account, it gives error message:
"Login failed for user <user name="">. The user is not associated with trusted SQL Server connection."
with Error no. 18452 Level 14 State 1. On the internet, i have searched for the solution of this problem, but they only say that you should change the authentication mode of your SQL Express from Windows to Mixed. I did that( as last step of my installer's custom action). But that did not work also.
Another important point is that, I am using standard SQL Server 2005 for accessing SQL Express. There it shows its authentication mode of SQL Express correctly as SQL Server's authentication after i have changed it in custom action. But it also does not allow to login using that user name and login. Also if i create any account using SQL Server Management Studio in SQL Express, that account is also unable to login using SQL Server's authentication.
Please help me to solve that problem. Any suggetion, any link etc...
Regards,
Wasif Ehsan.
|
|
|
|
|
Once you change it to mixed, it will work, so long as you're using a login that is valid for that instance of SQL Server.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
We have windows service as batch application and web application as configuration GUI for batch application. I am trying to package it using VS 2003 Deployment options, not sure which project to choose.
Installing package(setup.exe) should create webforms in Virtual root and install windows service.I know how to use service installer and web setup, but not sure how to combine both.
Regards,
MaulikCE
Regards,
MaulikCE
|
|
|
|