|
if your project doesnt require any other file(like dll, txt file, etc) and if copied computer has .net framework(releated to your project) probably it will work. but i advice you make setup project of it
|
|
|
|
|
How To make a setup project if i make setup project then if installed in some other pc will it require framework 2.0 and if it have some additional dlls and classes plz explain thanx & regards
SAS
|
|
|
|
|
1- if you make a setup project or not, other pc will require framework when you start the program it hasnt your program wont run!
if you want to make a setup project follow the related link
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vbtskCreatingOrAddingSetupProject.asp
while you making setup project you can add you additional files. Also if other pc doesnt have framework it will you give a warning (there is no framework before installion) and give a link to microsoft framework download side, you can connect this side, or you can add framework to your setup project. (If you have framework installation file) if you have not, download it from microsoft. i hope that good for you
|
|
|
|
|
Under the debug folder you will also find the dll files of your dependencies and projects in your solution. All those files need to be on the target machine that you want to run your program from.
If you want to create a single exe that does the actual installation of the program (i.e. copy all the needed dll files onto the target machine you need to create a deployment project if you are using Visual Studio, otherwise you will need to get an external installer program which will package it all into a single exe file.)
If you are developing on the .Net framework you need to make sure that the target machine has the correct version of the framework installed.
He who laughs last is a bit on the slow side
|
|
|
|
|
What about csc yourcs.cs in the simplest case?
Type csc /? from your command line and see a lot more!
SkyWalker
|
|
|
|
|
I should point out, if you have made an application, you must have compiled the app, in order for it to run. This means you have already created the exe.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
It's not in debug it's in release folder... at least in express ed.
|
|
|
|
|
debug or release folder is depending on debugging options.
on visual studio debug is default
|
|
|
|
|
I have the following block of code
if( (nDecisionDate.CompareTo(timePickFrom.Value) >= 0) &&
(nDecisionDate.CompareTo(timePickTo.Value) <= 0)
)
{
//processing here
}
nDecisionDate is a DateTime type while timePickFrom is of type System.Windows.Forms.DateTimePicker. The code compiles and runs but it misses to go inside the block whenever nDecisionDate is equal to the beginning of the inclusive dates (i.e. the = in >=). What is the best way to compare a DateTime type to a DateTimePicker from a calendar tool?
it might be worth noting that nDecisionDate is a DateTime type that was cast from a string class which was from a sql resultset which is of type DateTime.
Thank you in advance.
|
|
|
|
|
You can subtract a DateTime from another and get a timespan. Also, you may find that this fails because the days are equal, but the times are not as you'd hoped.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Are you comparing both date *and* time components of the DateTime instances, or just the date component? That is, is nDecisionDate initialized from something like "01/04/2007" or "01/04/2007 09:37:55"? If you're only comparing the dates (as opposed to the date and time), your values in your DateTimePicker instances may have different time components than your decision instance, thereby making the comparison fail for seemingly equal values (when viewed at the date level of granularity).
-Phil
|
|
|
|
|
You can compare just the date part of a datetime object as below.
DateTime dt1 = new DateTime(2007, 01, 10, 9, 0, 0);<br />
DateTime dt2 = new DateTime(2007, 01, 10, 9, 0, 1);<br />
Console.WriteLine("datetime compare: " + (dt1.CompareTo(dt2) >= 0).ToString());<br />
Console.WriteLine("date compare: " + (dt1.Date.CompareTo(dt2.Date) >= 0).ToString());
Russ
|
|
|
|
|
I want to have CPU usage for my application in %. I am using PerformanceCounter, sometime it give values greater than 100. I need CPU usage on a scale of 0-100 like we see it in task manager.
I am using it like this..
Process testProcess = Process.GetCurrentProcess();
PerformanceCounter cpuPerformance = new PerformanceCounter("Process", "% Processor Time", testProcess.ProcessName);
while(true)
{
// some staements
double cpuUsage = cpuPerformance.NextValue();
//some statements
}
Thanks in advance
Praveen Raghuvanshi
Software Engineer
|
|
|
|
|
Are you seeing this on a dual-processor or dual-core processor (or maybe even a hyper-threaded processor) machine? I seem to recall reading that CPU utilization for an individual process can sometimes be greater than 100% because of threads within the process being executed simultaneously across multiple processors/cores. I could be completely wrong about that, though.
-Phil
|
|
|
|
|
i,m using c#2005 and sqlexpress.
in my projects i use separate class for db connection and call that on project.
there i use connection string as
ConnectionString = "Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\Database\\stock.mdf;Integrated Security=True;User Instance=True";
as i understand this db created on project location and it attached to sql server when project(or build exe) running. after successfully build project i could see db had attached to server as "D:\Equipmanager\Equipmanager\bin\Debug\Database\stock.mdf"
everything ok.db connection works fine.
but problem comes when i start reports.
there i tried on ADO.net and OLE DB.but wizard shows only default dbs.master etc....(actually my project db attached to server when running.show how it show there?)
here's my problem...
1. can i use this connection string...is there any problem...
2. how to use project db for reporting(use crystal report)..?should i attached db manually and do report?
if i use sql 2000 this problem ok.because there every db is attached and not separate file.
currently i get db details by code and pass those to report(actually this connection string fine.because when deploying db is automatically attached.no need to do it manually)
but passing parameter is not good when long report.that's why i want to find way connect db to report?
|
|
|
|
|
did you try copy your mdf file to near of other standard mdf file, maybe it can checks constant path
|
|
|
|
|
sorry
i can't get what you'r saying.could you please explain
|
|
|
|
|
Sorry for late reply,
you have said that your mdf file is on
D:\Equipmanager\Equipmanager\bin\Debug\Database\stock.mdf, right.
but if you use wizard you said that you can see default database(like master), and i suggest you copy stock.mdf to master.mdf's folder
I wish to it is ok for you
|
|
|
|
|
thx.
but that's not working..
now i use this way
create dataset and populate it using database table and write xmlschema from dataset
then use xml file as database file of report.it works fine
|
|
|
|
|
I have a bug in .NET which I'm trying to repro for Microsoft. To repro this bug, my app needs to respond to events raised by a COM object.
In my app, this object is iTunes. However, for my repro, I want to use a COM object already installed on a common XP setup.
So - are you aware of a COM object I can create in my app, which raises events for which I can create a handler?
Preferably, this COM object has a UI, so I can control when the events are fired. For instance, with iTunes I create an instance of iTunes, then create a handler for the VolumeChanged event, then I click on iTunes and move the volume slider. Each change sends an event to my app.
Anything like this laying around in windows?
Thanks!
|
|
|
|
|
You could write a quick little .NET wrapper around the IE WebBrowser ActiveX control. It implements a number of events, such as when a document has completed loading. You could then control the firing of the event by navigating to a new page.
I'm curious, what is the bug you're seeing?
-Phil
|
|
|
|
|
Apparently I didn't make it clear enough that I didn't want to put that much work into this.
I'm really looking for a ham sandwich here - a pre-made ham sandwich: an object which launches an application with a UI, that will send me messages. I really don't want to write any more code than I currently am:
itunes = new iTunesLib.iTunesApp();<br />
itunes.OnSoundVolumeChangedEvent += new _IiTunesEvents_OnSoundVolumeChangedEventEventHandler(itunes_OnSoundVolumeChangedEvent);<br />
So, if it's not about that easy, or you don't have the 4-5 lines of coded already written, I'm just too damn lazy to go beyond that.
The bug:
In the app, when I get the message I add it's text to a table, which is bound to a DataGridView. If my app is in the foreground, everything is hunky dory - the event hits, the DataGridViewadds a row, the event text is displayed.
When my app is not foreground (ie, the app raising the events is foreground), two bugs occur:
1. when my app is hosted by VS, no RowsAdded event fires for the DataGridView, and it is not redrawn. So, it looks like nothing appears. Calling dgv.Refresh() will cause the new rows to be shown, yet RowsAdded was never fired, ever.
2. in RELEASE (not hosted by VS), it's worse. Although each row shows up after the event, as soon as there are enough rows for the vertical scrollbar to try to appear, the app "hangs". The cursor is busy, the UI is unresponsive. Clicking the close box on the title bar causes windows to report the app as not responding. Interestingly enough, though, there's no CPU being eaten - no looping.
I've written a really simple sample app to demo this, but it requires itunes. I'd prefer to use a COM object installed on any given XP machine.
|
|
|
|
|
And to follow up - I verified this does not happen when you simply have a timer add rows while the app is not foreground. It's specific to handing events which come from the "outside" of the app.
|
|
|
|
|
When you add text to the table in response to the external application's event being fired, do you do so from the UI thread (say, via Invoke()) or directly within the event handler?
-Phil
|
|
|
|
|
I wrote a simple little iTunes listener that shows similar odd behavior. It's just a WinForm application that has a text box that is updated with the new volume as it is changed within iTunes.
public partial class Form1 : Form<br />
{<br />
private iTunesLib.iTunesApp app;<br />
<br />
public Form1()<br />
{<br />
InitializeComponent();<br />
<br />
app = new iTunesLib.iTunesApp();<br />
<br />
app.OnSoundVolumeChangedEvent += new iTunesLib._IiTunesEvents_OnSoundVolumeChangedEventEventHandler(app_OnSoundVolumeChangedEvent);<br />
}<br />
<br />
void app_OnSoundVolumeChangedEvent(int newVolume)<br />
{<br />
<br />
textBox1.Text = String.Format("{0}: {1}\r\n{2}", DateTime.Now, newVolume, textBox1.Text);<br />
}<br />
}
When the application is run and the volume is changed in iTunes, the textbox won't show the updates (or will, but not dependably). If you comment the "doesn't work" code and uncomment the "works" code, all the updates are displayed. What the example demonstrates is the need to make all updates to the UI on the UI thread, else the behavior of the UI can be undefined. This includes, as far as I know anyway, updates to data bound to UI elements (because those updates indirectly trigger updates to the UI).
(I apologize if this is all old-hat to you already.)
-Phil
|
|
|
|