|
Hello all,
I want to create a centeralized exception handling in Client class. There are around 10 public methods in my client class , which can be executed directly. If the server is not available , exception is throw of non-availability of server, which i can catch by writing try...catch block in all the methods. But that will look messy, so , i am trying to create a centralized exception handling method. When there is any type of error from Server it should go to that centralized method at client. Is there anything like interface, which i can implement in client class and implement the methods?
Thanks
|
|
|
|
|
hi i am working with asp.net 2005 with C# code.. so now i am doing registration page so i sending field 2 database..and i took loginId field as a columnName and it having primary key i want generate automatically.. when new user ll register .....so now i m sending fields 2 backend but i got error...
The name 'bdgr' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted.
bdgr is my field name...
thanks 2 all..
|
|
|
|
|
It looks like there is a syntax error in your SQL statement. Post your code and I will try and help you out.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Let's look at the following scenario to begin... I have two projects, project A and project B. I would like project B to add a reference to project A if and only if a variable (named 'IsClient') is defined for the project using the "/define:IsClient" directive. I also have code within a #if/#endif precompiler directive block that is to be ignored unless this same variable (IsClient) is defined. I found this[^] reference on MSDN explaining build conditions, but it only tells me how to check for string equality/inequality or file existance. I am wondering how I can accomplish BOTH conditional project includes AND conditional code compilation by setting/defining a single variable. Some of the attempts I have made within the .csproj file for project B are listed below...
...
<ItemGroup>
<ProjectReference Condition="SeeBelow" Include="..\A\A.csproj">
<Project>{GUID}</Project>
<Name>A</Name>
</ProjectReference>
</ItemGroup>
... Where the phrase SeeBelow appears in the example above (from B.csproj), I have tried the following syntax...
IsClient
$(IsClient)
$(IsClient) != ''
'$IsClient' != '' I could really use some help here, as I am completely dumbfounded. Again, I am trying to see if the variable IsClient has been defined. Thanks in advance,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
Hi,
I have a need to copy an access table in one database to another database. Its ok to overwrite the entire table but ive tried all sorts to acheive this but nothing as yet ive managed to get right.
Im fairly new to programming so please go easy!!
The table in the source database is testdb.live and the destination is destdb.live both are identical tables, same headings etc.
Any help is greatly appreciated.
|
|
|
|
|
i guess you want to copy data from one table to other with same schema. I am not sure whether these support access db but i guess you can try this with DTS package (in case of less amount of data) or SSIS (in case of large amount of data)
Until you realize this message has nothing to say, its too late to stop reading
|
|
|
|
|
Does anyone know why the following code does not have any affect in the cellClick event of a datagridview control?
dgvSecurityPricing.Rows[e.RowIndex].Cells["AcceptBestPrice"].Value = false;
This should un-check the checkbox control inside the datagridview but it does not because in the cellformatting event for some reason
dgvSecurityPricing.Rows[e.RowIndex].Cells["AcceptBestPrice"].Value
gets set to true
There is nothing in the cellformatting event that does anything with this checkbox field, and so I am puzzled why this is happening.
Thanks
|
|
|
|
|
Do you have this working yet?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hy,I have a problem..I am creating some controls(that basically have some images) and I need to draw them,refreshing very fast. This is why I use manual double buffering(i.e. memory graphics), but for this to be good enough I must draw all the controls in one place(in form's paint). All I want the control's to do is to tell the form that their image was changed, so it should draw the new image(basically...the controls are sprites).
Does anyone have any ideea how to draw all the controls in the the form? My problem is that I need to completely remove control's default painting behaviour. If not..I will get flickering.
PLEASE HELP!
|
|
|
|
|
You really should give people a chance to answer before posting again.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
Sorry, my vrowser was not responding and i didn't know it was sent..
And I was in a hurry to write it again as I reel need help Sorry
|
|
|
|
|
Perhaps if we knew why you wanted to do this. It doesn't make much sense to me.
My current favourite word is: Bauble!
-SK Genius
|
|
|
|
|
Sorry,I didn't give all the details. My controls are all image-based, but I wan't to also use them as sprites(I'm developing 2D games). I can't use the control's painting, because I will never get rid of flickering. Now..the form in it's onpaint already has access to all this control, so it's not hard to call child.GetImage() for example. That is what manual double buffering means..all painting is done in one place(form.onpaint)
I don't now how to stop the controls from using their default-painting.
Here is what I have at this moment for the control:
<br />
public class MyControl : Control<br />
{<br />
...<br />
private bool visible = true;<br />
<br />
public bool isValid;<br />
<br />
...<br />
public Image GetImage()
...<br />
protected override void OnPaintBackground(PaintEventArgs pevent)<br />
{<br />
}<br />
<br />
protected override void OnPaint(PaintEventArgs e)<br />
{<br />
isVisible = false;
Parent.Invalidate()
ValidateRect(this.Handlde) <br />
}<br />
Now..this is what the form should do:
<br />
public partial class TestForm : Form<br />
{<br />
...<br />
protected override void OnPaint(PaintEventArgs e)<br />
{ <br />
for (int i = Controls.Count - 1; i >= 0; i--)<br />
{<br />
if (Controls[i] is MyControl)<br />
{<br />
if (!((MyControl)Controls[i]).IsValid && ((MyControl)Controls[i]).GetImage() != null)<br />
{<br />
grafx.Graphics.DrawImageUnscaledAndClipped<br />
(((MyControl)Controls[i]).GetImage(),<br />
((MyControl)Controls[i]).ImageRect);<br />
((MyControl)Controls[i]).IsValid = true;
}<br />
}<br />
}<br />
grafx.Render(e.Graphics);
}<br />
Using this code..will invalidate the form continuously... blocking the form
What have I left out?
If I don't make MyControl derive from Control will not give me design-time support..but Control
implements IWin32Window so it get's messages fron the system..not the form.
Thanks very much for your patience..sorry I'm not very good at explaining
|
|
|
|
|
If your making a 2D game, then it would be best to stop using controls for your sprites at all, make a struct or class to contain the location, size, image and any other necessary properties, and do the drawing yourself, that would be much better.
But, if you want to continue using controls, try adding Application.DoEvents(); to give time back to the application for updating and whatnot.
My current favourite word is: Bauble!
-SK Genius
|
|
|
|
|
I can't use DoEvents()..that method processes all the messages in the message queue, so if I use that before the painting, my framerate would depend on what the client does with the mouse\keyboard.
My present games are like you said, a class with all the information, but I could develop them in..Notepad
I need the design-time support of Visual Studio, that's why I choose controls.
If I use controls I don't need to whorry about when the mouse enters,leaves etc..
No..again..I have only one problem with controls...I don't want them do do painting att all, but still..when the control receives a WM_PAINT..it should tell the Parent that it's Image it's no longer updated. I don't know 100% how paint messages work, but I think windows keeps sending WM_PAINT if the wnidows update region is not NULL.
|
|
|
|
|
Hi guys
I am going to reuse vnchook.dll in c#.net application.
Please any body has any idea?
thanks in advance.
naresh is testing the site.
|
|
|
|
|
I have a UI with text fields, I want them to be filled with the data from the access database. I want it to go in a order, so each time I run it, I want it to read the next column values and print it to the textfields.
Whats the way to do it?
UI, project is in C# .NET2005
|
|
|
|
|
What have you tried that hasn't worked for you?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
|
Do you have this working yet?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hy,I have a bing problem. I am developing an application that refreshes itself very-very fast, this is why I am using manual double buffering for drawing(i.e a memory graphics). I want to develop my app at design-time,that is why I place a lot of controls on the form(they all have an Image that they want to display).
But I need to draw them all in one place(i.e Form.OnPaint()).
How can I completely remove paint messages sent to the controls, and still give feedback to the form, whenever a control receives a paint message?
I need something like this:
Control.Onpaint()
{
//tell the parent that it should ask me for my image and draw it
//validate my update region,sa I don't get paint messages until I am invalidated
}
If anyone can help me..thank you in advance, it's a big problem for me.
|
|
|
|
|
make them invisible.
Greetings from Germany
|
|
|
|
|
Well..this doesn't help me as i need to use the same double buffering at design-time and run-time. First, Visible is always true at design-time you can't set it to false. Second, if i don't draw all the controls in the same place, I can't toggle from Visible=true\false,as transparency for the control(this.BackColor) means what's under all the controls(i.e. the background). I wan't the controls to look at design-time like layers.
Again..I need the controls to do no painting at all..the form does everything in one place
|
|
|
|
|
I have absolutely no idea what you are asking here. I have read this post multiple times, and cannot for the life of me figure out your problem. Do you think you could restate the problem another way, and additionally give a broad overview of what you are trying to accomplish? Thanks,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
Please read my answer in the upper thread..I accidentally started 2 threads.Sorry
|
|
|
|