|
- you can get the resolution through:
Screen.PrimaryScreen.WorkingArea.Width and Screen.PrimaryScreen.WorkingArea.Height
As for the second question, there are two ways to do it -
1) Create a base form which is what you have now, then inherit it for the different sizes and adjust the position of the controls in the designer (this is what I do)
2) Manually calculate the position of each control based on the width and height of the resolution of the monitor against the default resolution you have designed for.
David
|
|
|
|
|
In a C# 2008 solution file, there are 4 project files that interact with each other. While I am in the project file called 'app1', I want to be able to obtain the values in another project file called 'samples'.
When I am in debug looking at the locals window, I can see the value I want to obtain is in the following location: samples.PackageMetadata.SubCustomerNumber.
However I am getting the error: An object reference is required for the non-static field, method, or property 'samples.PackageMetadata.SubCustomerNumber.get'.
Thus can you show me code and tell me what I need to do so that I can obtain the 'SubCustomerNumber' value I need for an error message?
|
|
|
|
|
From that? Probably not.
How about you share the code fragment which shows the problem?
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
I get SqlTransaction.Zombie exception in production(In .NET Windows application not ASP.NET application). I got answer in below article how and when the exception is thrown. In production one server application available which perform DB operation and there could be more than one client applications to interact with server.
http://blogs.msdn.com/b/dataaccesstechnologies/archive/2010/08/24/zombie-check-on-transaction-error-this-sqltransaction-has-completed-it-is-no-longer-usable.aspx
In the article, it is given that connection is explicitly closed. My question is in real world application what are the possibilities to close the connection (in few cases only it occurs in production)? I would like to hear the possible scenarios to reproduce it.
One of the servers is getting stopped due to the Exception. Please do help.
Is there possibility for SPs to close the connection unexpectedly? If so, please do describe. Thanks in advance.
|
|
|
|
|
Member 3137078 wrote: In production one server application available which perform DB operation and
there could be more than one client applications to interact with server.
In the normal usage of the word that has nothing to do with this.
Member 3137078 wrote: My question is in real world application what are the possibilities to close the
connection (in few cases only it occurs in production)?
As the link said - because in ONE application the connection is being shared between multiple threads.
Member 3137078 wrote: One of the servers is getting stopped due to the Exception. Please do help.
Then your code is wrong. The solution is fix it.
1. You are sharing connections between threads - stop doing that.
2. You are allowing sql exceptions to bubble up to the top instead of catch them and reporting them. So fix that.
Member 3137078 wrote: Is there possibility for SPs to close the connection unexpectedly
"SP"? But the answer to your question is probably no - at least in the context of this exception. Your code is closing it.
|
|
|
|
|
Thanks for your valuable answers.
You are sharing connections between threads - stop doing that. - Could you please explain (it would be great if you suggest some articles to understand this)?
|
|
|
|
|
I have written windows app (desktop app) that :
zip file and send it to host via ftp.
Now :
Is it possible to unzip the archive (.zip) in remote server right after uploading it?
|
|
|
|
|
jojoba2011 wrote: Is it possible to unzip the archive (.zip) in remote server right after uploading it
I'm not sure of the capabilities of FTP but I'd be astonished if you can execute a command on the server via FTP. Having said that you could do it via sql server
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
jojoba2011 wrote: Is it possible to unzip the archive (.zip) in remote server right after
uploading it?
From the client end (via FTP) - no. Is the server end under your control?
|
|
|
|
|
Check the allowable commands at the ftp server end, as some servers allow you to run commands via a remote shell.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
thanks for solution.
But how to do that ?
do you have any sample ?
|
|
|
|
|
Sample for what? I suggested that you check whether your ftp server will allow you to send commands that can be executed in a shell at the server end. If that is possible then you just need to send a command to do the unzipping. It does not need any code.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I need some help with a C++ problem.The problem is solved,i have the code and it runs perfectly but my teacher ask me to do some changes.The changes mean to move the declaretion of some constructors from a header file to his associate cpp file.I can t remember c++ programming with classes and stuff.Please help!
|
|
|
|
|
Wrong forum. This is the C# forum, not the C++ one.
|
|
|
|
|
I search for days now for a Nunit-problem, but I found no solution.
I have a c#-dll (built .net4.0)with test-fixtures inside. Eerything runs well.
But, when I make the "code-window" inside the "Errors and Failures" visible by dragging the splitter-bar, then I get an exception from NUnit and I can not see any code as expected. If I accept the exception by pressing "Continue", then a cross-mark is displayed.
Do you have any idea?
|
|
|
|
|
This is a problem with NUnit itself? You should raise it as an issue here[^].
|
|
|
|
|
how can I Pass a value from one page to another dont want to use session querystring class public members and static class in webapplication
page is protected i cant access value from sessions and query string
|
|
|
|
|
One option would be to store the values in database.
You can insert the data to be passed to another page in page 1 and then retrieve that information in page 2.
|
|
|
|
|
Can you post your code - I don't fully understand your question. Even though the page is protected, you should be able to access both session variables and query strings. I'm also not sure where static classes come into the problem.
|
|
|
|
|
|
You want to pass a value between pages, but don't actually want to use any of the obvious mechanisms that are provided to enable you to do so?
What is the value? The session is usually a good place to put temporary state variables.
|
|
|
|
|
If you want to pass the data from one page to another then the options available are:
Session
QueryString
Cookies
Application
Cache
See which one you could use. Here is an article that could help.
A Beginner's Tutorial on ASP.NET State Management[^]
P.S. Be very careful if you are using Application or Cache as they will be available longer and for many users.
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore, Dream. Discover.
|
|
|
|
|
Hello EveryOne ! I'm working on c# i'm making an bar-code application . In which i want to print the text above bar-code and it is possible with crystal reports but i don't know how to fetch pictures in crystal report and how to align them according to the page size ........ any help would be appreciated ... Thanks
Regard Mr.Saud Ahmed.
|
|
|
|
|
hi bax
i want to create a tree usage recursive function but i cant do this please help me
|
|
|
|
|
what have your tried so far?
Jibesh V P
|
|
|
|