|
|
Below is the code which get called during generation of installer
I wanted to retrieve the value of property of SETUPEXEDIR in a string..
Unable to do so.. please help
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
namespace ABC.CustomInstallation
{
[RunInstaller(true)]
public partial class CustomInstallation : Installer
{
public CustomInstallation()
{
InitializeComponent();
}
public override void Install(System.Collections.IDictionary stateSaver)
{
\\-- Here i want to check the SETUPEXEDIR value----\\
if some validation skip next 2 lines...
ConfigurationForm frmConfig = new ConfigurationForm();
frmConfig.ShowDialog();
base.Install(stateSaver);
}
}
}
|
|
|
|
|
i want to add pagination to datagrid?
please help me to do this
|
|
|
|
|
I'm sure there are articles on code project for doing this. Or, use a gridview.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
I'm using a System.Net.Sockets.Socket in a server application to handle a large number of connections which receive a large amount of data. I have in incoming buffer of around 1/2MB to be read at a time using a NetworkStream wrapped around the socket. It is my understanding that a call to NetworkStream.Read will read what is available up to the buffer size and not necessarily wait until it has enough data to fill the buffer, is this correct?
The reason I ask is because I am getting connections dropped from the server side and when I dump the TCP stream I see the TCP window size drop until it hits 0 at which point the connection is dropped. The only explanation I can think of for this is that the NetworkStream.Read is waiting too long for data and the buffer is filling up meaning no more data can be received. Does this sound correct or could there be something else causing this problem?
|
|
|
|
|
Hi,
I'm trying to write an application which monitor another application using WMI.
One of the parameter I need to monitor is CPU usage by the monitored application.
Just for the test - The tested process is devenv.exe(i.e Visual studio).
When running the application and printing to the outout window I see that the process CPU usage is 0%(while the task manager shows 20-30%).
Note that other parameters are OK(for example Virtual memory , Thread count etc.).
This is my code to get all parameters related to devenv.exe:
private void MonitoringTimer_Tick(object sender, EventArgs e)
{
ObjectQuery winQuery = new ObjectQuery("SELECT * FROM Win32_PerfFormattedData_PerfProc_Process WHERE Name = 'devenv'");
ManagementObjectSearcher searcher = new ManagementObjectSearcher(winQuery);
foreach (ManagementObject item in searcher.Get())
{
string s = "";
foreach (PropertyData PC in item.Properties)
{
if (PC.Value != null)
{
s = PC.Name + " : " + PC.Value.ToString();
}
else
{
s = PC.Name + " : NULL";
}
}
s = "******************************************************";
}
}
Can anyone help me solve this problem?
With best regards,
Eli
|
|
|
|
|
I've found that when using WMI you need to use NextValue() as opposed to Value.
Try that and see if it works.
|
|
|
|
|
Hi,
Thanks for your reply.
I'm looking for NextValue() and I can't find it(not in PropertyData and not in ManagementObject)...
Thanks again,
With best regards,
Eli
|
|
|
|
|
Hi all,
I have a program which made some components inheriting from Button class. There are many kinds of components all of which are inhertiting from a basemodule class and the basemodule class inherits from Button.
Whenever I make a project in my application I add some components to it. When I close a project and open it in the smae machin(computer) there is no problem. But when I make a project in a machin and then take it's files and try to open it in another machin my components(Button based) are resized to a very big size (about 100 times bigger).
I monitor all the program and encountered with a call of resize event but I cannot find its event caller. This shows that whenever I open a project in my application which was made in other PC the components are at first point added in their normal size. But then the size are changed (by who?! I don't know!) and the event of button resize is called!
I guessed that it comes from Framework. The version I used is .Net 2.0 but that is not related to the framework since in every machines the same problem happens!!!
Please help me to solve this problem... since this really got all my application's functionality.
Many Thanks,
Roza
|
|
|
|
|
Are you using the anchor or dock properties and running at different resolutions ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Thanks for your reply
I don't use anchor or dock for these components. I also check the resolution and again unfortunately no relation with
|
|
|
|
|
Well, controls do not magically resize themselves. Have you set the minsize and maxsize properties ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Yes I set! Do you have any technique to find from where an event is called?
|
|
|
|
|
Hi,
I am not pretty sure whether this is the exact forum for my question, so if I am in the wrong one..I am sorry..!
My problem :
I am developing a Windows Application in C# and I have to play around with Crystal Reports. This would be my first DesktopApplication and I am really messing around. I am though fond of Web Applications.
My application requires a MsAccess Database file and A crystal Report.This database file is to be kept in a shared location, from where it has to be accessed.
For calling reports, I don't know how to set path. As of now I am setting the actual local path of the report on my machine where I am developing the code.. [@"C:\blah\blah\report1.rpt"] and setting this file in the
reportDocument.Load(path) event.
How should I go about it for setting this path as dynamic. I tried using server.mappath but there is no such method supported.How should I load report from a dynamic path into reportDocument..?
Is there any other way out??
Also can I store both the crystal report files and Ms Access file, in one location and access it from my application..? Is this possible..?
How should be the database file / connection string set for accessing the .mdb file on the shared folder..??
I am new to this publishing method.. so if someone can throw some light on the same ,so that I can run .exe file on any machine and can access the .mdb file from the shared server.
Do post example path setting..!!
Cheers..
Jimish
|
|
|
|
|
Since you are an ASP.NET developer, I'm sure you keep all your connectionString information and other valuable configuration settings in web.config. You can do a similar thing with the app.config file in C# winforms.
The rules of accessing the app.config are very similar, you call the ConfigurationManager class to extract values from the file. So if your .mdb file path is //192.168.0.1/something.mdb just add a key into the app.config, I guess.
And yes it is possible to access both the .mdb and the .rpt files from a shared location.
var question = (_2b || !(_2b));
|
|
|
|
|
Ohh great..that sounds good..if this works...as in reports and mdb both on shared folder..will solve much of my probs..thnks..!
Jimish
|
|
|
|
|
hi,
plz tell me which Free Anti virus can remove this WORM_KLEZ.E virus...Thanks
"Programming is a fun"
|
|
|
|
|
Why on earth did you think this had anything at all to do with the C# forum? Please, in the future, don't randomly pick a topic to post in. However, you can download AVG[^] for free - that should take care of it.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
hello, Can NHibernate exit your app without throwing an exception?
I'm debugging a console app and
<br />
void main(...)<br />
{<br />
try {<br />
IPerson oParent = LoadPerson(123);<br />
<br />
} catch(Exception ex)<br />
{<br />
Console.WriteLine(ex.ToString());
}<br />
return;<br />
}<br />
<br />
public IPerson LoadPerson(long nId)<br />
...<br />
try {<br />
<br />
<br />
using (oScope = new TransactionScope(TransactionScopeOption.Required))<br />
{<br />
IPerson oParent = Session.Get(nId);<br />
<br />
LoadChildren(oParent);<br />
<br />
foreach(IPerson oChild in oParent.Children)<br />
{<br />
oChild.Parent = oParent;
<br />
oChild.Parent = new Person();
<br />
}<br />
}<br />
<br />
} catch (Exception ex)<br />
{<br />
Console.WriteLine(ex.ToString());
}<br />
<br />
returns oParent;<br />
}<br />
Any suggestion as to posssibility of NHibernate causing my WIN32 console app to exit silently? I have catch(Exception) on all levels but still I didn't manage to catch any exception and therefore don't know what killed it... I initially suspected loading children is a recursive ops but if infinitely recursion was the cause of death I should have a StackOverflowException do I? But I have nothing. I understand you can't "catch" a StackOverflowException" but still if you run app on debugger, debugger will be able to tell you that under all circumstances right? (I tested this on another simple toy app)
I am most suspicious you can't really assigned oParent to Child.Parent attribute within same transaction scope - even though oParent loaded first.
<br />
oChild.Parent = oParent;<br />
Many thanks.
dev
modified on Monday, March 30, 2009 4:04 AM
|
|
|
|
|
What you could do is download the source for NHibernate and debug your application with the source.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi,
I have installed VS 2005 last night. And build a simple C# Windows Application....I build this solution...the build is succeeded, but instead of output it prompts the following error message...
" The application failed to initialize the property (0xc000007b. Click OK to terminate the application ".
Please tell me how to solve this issue....Thanks in advance
"Programming is a fun"
|
|
|
|
|
A quick google search came up with the result that your pc is maybe infected with the WORM_KLEZ.E virus. To be sure about this, perform a virus scan.
Regards
Sebastian
|
|
|
|
|
A quicker google search revealed that the compiler comes with a debugger. Use it.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I am a beginner in C# Windows Application Development. I have developed an application with accounting package in three-tier architecture.
I am using a single static sql connection for entire application at present.
But I am not thinking it's a good practice. Please advise
|
|
|
|
|
Hi,
I thin you have a problem within your windows app, if it uses multi-threading. If you use transactions for example, running two or more transactions with one single connection will fail. But if you didn't use multi-threading within you app, everything should be okay. Problem will be when using your tiers within a web app (since the hosting is a single app with multi-threads for each session/request).
To be able to give you a more specific answer, you have to be more detailed about your app.
Regards
Sebastian
|
|
|
|