|
Don't repeat your question, use the edit button, we have all already seen your original post.
|
|
|
|
|
need to do the following with C#, under visual studio ,
when button "Start" been clicked the current time of the system must
be get and saved in a variable, when button "Stop" been clicked the current time of the system
must be get and saved in a variable, also the difference
between the stop and start must be get and displayed in a text box (in seconds),
please need the C# code for that,
i treid with
DateTime dt = new DateTime();
dt.seconds;
but it did not work. any help will be appricated.
|
|
|
|
|
As always with simple problems like this your first port of call should be the documentation. Put the cursor over DateTime in your code and press F1. Browse down through the help to the DateTime.Now property which you will find very useful in the context of your problem.
If you also read up on the TimeSpan structure you'll have a solution in a few minutes.
Good luck, Alan.
|
|
|
|
|
The DateTime.Now [^] property looks promising...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
As the other replier said, documentation should always be your first line of defense (or offense?). Let me say, welcome to codeproject, you'll find a lot of helpful people here. None of which will sen dyou the code for anything, and you will usually be scorned or smitten with an array of witty subjective insults belittling you for not reading the rules and doing something as insulting as demanding free code.
With that being said, this clearly seems like homework for a basic programming course, if you are having that much difficulty, please, go see your teacher. Get a better understanding of what it is you need to do and start reading that textbook you hopefully purchased for this course.
|
|
|
|
|
Hi All i want to print only Panel contents on Window form...please reply..thanks in advance..
|
|
|
|
|
Have you tried anything at all yet?
|
|
|
|
|
Hello everyone,
I met with issues when browse for WSDL information for a web service. When I am using F5 in Visual Studio to browse http://localhost:21530/Service1.asmx, everything is fine (e.g. web service textual description is shown)
But when I pubish the web services to my local IIS 6.0 server and browse from IE http://localhost/Service1.asmx, here are the error message and my simple web services source code.
Does anyone have any ideas why?
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
public class Service1 : System.Web.Services.WebService
{
[WebMethod]
public double HelloWorld()
{
return new Random().NextDouble();
}
}
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
--------------------------------------------------------------------------------
A name was started with an invalid character. Error processing resource 'http://localhost/Service1.asmx'. Line 1, Position...
<%@ WebService Language="C#" CodeBehind="Service1.asmx.cs" Class="TestWebServicePerformancev1.Service1" %>
-^
thanks in advance,
George
|
|
|
|
|
Probably it's security issue of your server. Check your Web.settings
|
|
|
|
|
Where do you mean the Web.setings file? Do you mean Web.config?
regards,
George
|
|
|
|
|
I'm sorry my mistake. I mean check your web.config and server configuration where you upload your files as well. I had similar problem.
|
|
|
|
|
Here is the content for web.config. Are there anything wrong?
<?xml version="1.0"?>
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
</configuration>
regards,
George
|
|
|
|
|
Hi,
I want to run application when I start computer. How can I set automatically while creating setup.
Thanks,
sjs
|
|
|
|
|
|
1. Use the Windows Scheduler to run your application when you start the computer.
2. Write your own code to make your application work as a start up app.
You can also modify the registry settings manually to add the start up applications. Use google to get the Registry key.
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
Add your application path to the registry.
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run or RunOnce
|
|
|
|
|
in my app i want to read huge no of records(100000) from the db using one connection. i want to do this using threads, how can i get the data in parallel. but the problem is how to tell one thread to get specified range of data(ex : thread1 ->1-1000,thread 2 ->1001 to 2000) etc.
|
|
|
|
|
Im no expert on this but if your only using one connection then surely the data transfer can only handle one query at a time? therefore using multiple threads would be slower than one thread, as each thread would have to wait for the other to finish with the connection, the reason i say 'slower'is because you would need additional checks to determine when another thread has finished
|
|
|
|
|
as i know that using one connection we can do multiple database calls.the problem is using one connection how to retrieve data from the same table,to listview is there any other way to solve this.
|
|
|
|
|
prasadbuddhika wrote: we can do multiple database calls
Not at the same time, you'd need multiple connections.
System.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first.
You may not get much of an improvement anyway, because the network IO may be the slowest link.
|
|
|
|
|
prasadbuddhika wrote: i want to read huge no of records(100000) from the db using one connection. i want to do this using threads, how can i get the data in parallel
In order to do this, you must use multiple connections, one for each simultaneous access.
prasadbuddhika wrote: problem is how to tell one thread to get specified range of data
Use BackgroundWorker and RunWorkerAsync method. Create a simple class which holds the data for you (range start and amount of data) and pass that to the RunWorkerAsync method.
Warning, it's very likely that this will be slower than fetching all at once. Especially if you're going to use the amount of records as the range (instead of for example primary key values), the throughput will be catastrophic.
|
|
|
|
|
thanx,i would like to know how huge amount of data retreived in most situations, do they use one connection always to do this or is there any other way to do this in industry level.
|
|
|
|
|
prasadbuddhika wrote: in industry level
By not retrieving huge amounts of data.
|
|
|
|
|
The most important thing is to retrieve only what you need. Don't fetch data from the database and then eliminate rows and discard data on client side. That will lead to performance problems. Use the capabilities of SQL language. SQL language and database engines are developed from 1970's so by now they have very sophisticated mechanisms to optimize data retrieval to get you only tehat you need in decent time.
|
|
|
|
|
ArrayList al = new ArrayList();
al.Add("#98,yuyu street,,,");
al.Add("#55,ty road");
how can i pass these two values as input seperately... pls help
the quieter u become more u hear
|
|
|
|