|
i have tow qutions
1-how i can create query wizard in c sharp
2-i need add the result form query to colume in datagridview control
note
i am using c sharp .net
|
|
|
|
|
1 - what do you mean by query wizard ? To talk to a DB ? You connect, you take input, and you run it on the DB.
2 - Then you add a column and put the values in there
mohammad alnoed wrote: note
i am using c sharp .net
Well, in this forum, of course you are.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
yes I was creating connection to access database using wizard connection
but i do not know how i can create query by wizard
after that i need to add the result to colume in datagridview
datagridview1.Rows[1].cell[2].vlaues="i want add the query wizard here";
thanks
|
|
|
|
|
I have a class called CardHolder which extends UserControl. I have overrode its OnPaint function like so:
protected override void OnPaint(PaintEventArgs e)<br />
{<br />
base.OnPaint(e);<br />
<br />
Graphics g = e.Graphics;<br />
<br />
foreach (Card c in this.Controls)<br />
{<br />
g.DrawImage(c.Image, c.Location);<br />
}<br />
}
Each image is tied to a Control which has been added to this control. Each image is a partially transparent image which is partially overlaid another image. However, each time the OnPaint function is called, it doesn't clear the Control of what was there before:
Good: http://img20.imageshack.us/i/goodw.jpg/[^]
Oh dear: http://img24.imageshack.us/i/ohdearz.jpg/[^]
I've hooked into the CardHolder's Resize event and call PositionCards in that function to position the Controls, which in turn calls OnPaint behind the scenes. I hope what I'm doing here makes sense to you guys. How do I clear the Control of the previously drawn images?
Card extends UserControl as well but is transparent and has no child controls.
modified on Tuesday, July 21, 2009 12:36 PM
|
|
|
|
|
How is the OnPaint being called? Call the Refresh() method to make your control invalidate the graphic and repaint itself.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
I don't know how OnPaint is being called. I'll give Refresh a try.
[Edit]
Thanks Nagy Vilmos.
modified on Tuesday, July 21, 2009 12:35 PM
|
|
|
|
|
i want to filter report made by Crystal Reports
and i made it by the wizard
and here is an example so i want to pass the value of the field of Employee Name For example from a textbox or another contorle by the user then the report appears the records that the user want to display
and many thanks for you
http://ahmedkhallaf.brinkster.net/WindowsFormsApplication1.rar[^]
Allah bless the prophet Mohammed
|
|
|
|
|
0. No-one will download your code and fix it for you.
1. I am not a fan of CrappyReports; they have to grind down cute puppies to build this software.
2. I am guessing you have a paramatised report and a form for entering said paramater. Check the CR documentation [har har] on how to pass on to the other.
3. There are 865,492 better reporting tools that are free!
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
thank you for you kind reply and i have fixed my problem
Allah bless the prophet Mohammed
|
|
|
|
|
Hi from what I understand, the built-in System.Windows.Forms.Label class inherits from the System.Windows.Forms.Control class. Is there any way to change the Form.Label class' inheritance to a custom (SectionControl) class which is derived from the Forms.Control class?
so basically,
class SectionControl : Control
class MyLabel : Label
but override/replace the existing implict 'System.Windows.Forms.Label : Control' inheritance to 'System.Windows.Forms.Label : SectionControl'.
That way I get the benefits from both the SectionControl and MyLabel specializations. If this is possible I would proceed to add MyTextBox, MyCheckBox, etc... classes also deriving from the obvious parent and thereby retaining the commonality of all the custom controls in the SectionControl class. As C# doesn't allow multiple inheritance, and as i'm not interested in a semantic Interface either I'm at a loss. Any suggestions?
|
|
|
|
|
No. But you could wrap a Label in something that derives from SectionControl.
|
|
|
|
|
Hi All,
Is it possible to calculate Efficiency of different Business Units on the basis some inputs and output using Microsoft Solver Foundation?
Following is the sample data for which efficiency needs to calculate.
Each row here represent the details of each Business Units.
1st column "Location" contains the location of business unit
2nd & 3rd columns "Personal" & "Business" are the outputs
4th column "Staff" is the input.
Location Personal Business Staff
Croydon 125 50 18
Dorking 44 20 16
Redhill 80 55 17
Reigate 23 12 11
In MS Excel, there is a add-in named as "Solver" that can be used to calculate the efficiency. For that we need to add the weighted output, weighted input and some more columns to meet the requirement of Solver add-in.
I believe some thing similar should be existing with Microsoft Solver Foundation, and can be calculate the efficiency programatically.
you all are requested to provide your thoughts on the same...
An earlier reply will be appreciated.
Regards,
Anuj Chauhan
anuj.mca@gmail.com
+91 9313499294
http://www.linkedin.com/in/anujchauhan[^]
|
|
|
|
|
Hi!
I want to get the file path hosted by a certain excel process. I have its Process object only.
Thanks in advance.
|
|
|
|
|
Check the Link
Hope it helps
Cheers!!
Brij
|
|
|
|
|
Thanks for your reply. But that code brings focus forcefully to the excel application which I dont want and Marshal.GetActiveObject() will not work in that case.
|
|
|
|
|
Hi
I have a timer which I've created in runtime with System.Timers.Timer myTimer = new System.Timers.Timer(10000);
I make some settings of this timer and start it with this code:
myTimer.Elapsed += new ElapsedEventHandler(myMethod);
myTimer.Start();
After myTimer started I stop myTimer using myTimer.Stop();
Some time later I need to start myTimer again so I start it with myTimer.Start(); But the weird thing is that it didn't actually stop when myTimer.Stop(); was executed. It's like two instances of myTimer are ticking at different times but I just want the last one to work.
How can I solve this problem?
Thanks in advance.
|
|
|
|
|
I think the code block where new ElapsedEventHandler is added is called more than once.
It means when even is raised, more than once the myMethod will be called, and hence the timer will be incremented.
|
|
|
|
|
So can I add more than one ElapsedEventHandler to my timer right?
If I
myTimer.Elapsed += new ElapsedEventHandler(Method1);
myTimer.Elapsed += new ElapsedEventHandler(Method2);
then when myTimer ticks both Method1 and Method2 runs, right?
If I
myTimer.Elapsed += new ElapsedEventHandler(Method);
myTimer.Elapsed += new ElapsedEventHandler(Method);
then when myTimer ticks Method will run twice, right?
|
|
|
|
|
|
Right, right and right again.
|
|
|
|
|
Thank you, then problem solved
|
|
|
|
|
Yes, but I doubt you want to do that; did you do that accidently?
|
|
|
|
|
|
So on every block I think it is better to do
myTimer.Elapsed -= new ElapsedEventHandler(Method);
myTimer.Elapsed += new ElapsedEventHandler(Method);
By this way even if this block is running more than one, everytime it will remove the eventhandler and then add it. Provided, if you are unsure that this block will run more than once.
|
|
|
|
|
Thank you, that is a nice way of doing it too.
But I solved it with adding a global int called Session with default value 0. And everytime I get this adding ElapsedEventHandler if this session is greater than 1 I don't add it.
|
|
|
|