|
I'll give Question 2 a go
Create an ArrayList called SelectedRowsList for your rows,records??.
Then on MouseClick on your Datagrid.
if (Datagrid.RowCount > 0 && Datagrid.CurrentRow != null)<br />
{<br />
selectedrow = Datagrid.CurrentCellAddress.Y;<br />
SelectedRowsList.Add(selectedrow);<br />
}
I think this is what you asked... hope it helps
A craft is an enemy if not well learned.
|
|
|
|
|
3. Application.ExecutablePath
4. search CodeProject for "application singleton"
whatever the solution is, the application will be launched a second time, but it will be able
to signal that (and optionally pass the new command line) to the first instance.
|
|
|
|
|
I saw many examples over the net like
<br />
[Serializable]<br />
public class Customer<br />
{<br />
}<br />
What is the meaning of the Serializable...? What it will do..?
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
Since nobody is around to give you a better explanation, I'll give you a real light view:
It basically means that the object/data can be persisted beyond the lifetime of your application - that is, saved. Written down somewhere. Like on disk.
The real meaning is actually more abstract than that, but this is a pretty good start.
Do some searching in Google or in the MS SDK documentation, you'll see a lot more on it.
|
|
|
|
|
|
JoeRip,
Thanks for your reply. But I can't get the line
"It basically means that the object/data can be persisted beyond the lifetime of your application - that is, saved. Written down somewhere. Like on disk."
If My application is closed then how would I know the object is persist or not...? If persist then what is the name of it and how can I access it...?
And when I set objCustomer=null then it automatically destroyed and if I can't do this the GC will automatically clear it from memory....
Please reply....
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
modified on Saturday, December 15, 2007 3:33:31 AM
|
|
|
|
|
You have to write the code to serialize the object to a file on disk, or some other data store. It doesn't happen automatically.
|
|
|
|
|
You didn't ask how to do it, you asked what it meant.
If you follow the link I sent you, it's all explained. Some of the existing .NET / CLR classes are already serializable, meaning the work has been done to allow you to serialize them. For your own objects, there is plenty of information in MSDN on how to write specific serialization code. Start at the link I gave you.
|
|
|
|
|
I have 4 processes that running on some machine - 3 of them are exe files and one of them is some Dll.
I want to find the path of those 4 file - i know the process name of each of those process.
How can i find the path ?
Thanks for the help.
|
|
|
|
|
You can use Process.GetProcessesByName("processName") method to get the instance of process class associated with the process started by the executable you are interested in. After that use the MainModule property of process class to retrieve the executable path.
|
|
|
|
|
Is there a generally accepted method for detecting the launch of a third party exe?
I can think of a few methods, but I'm not sure what is the generally accepted method:
1. get the location of the exe on disk, and use a FileSystemWatcher on it (haven't tested this yet)
2. scan the process list periodically, watching to see if the process name in question shows up
Is there a better way?
|
|
|
|
|
If you know path of the executable file you can use FileSystemWatcher to monitor start. However, you can detect creation and deletion of any process using WMI.
|
|
|
|
|
You can use WMI and the classes in the System.Management namespace to do this.
Th FileSystemWatcher will do you no good in this case because the .EXE will not change when you launch it.
|
|
|
|
|
1. I did ask if anybody knew about what the generally accepted way to do this was... any comment there?
2. The method you recommend - could you at least toss a few methods or properties my way? "You can use WMI and the System.Management namespace to do this... see the XXXX method, for example." would have been great.
Unfortunately, what I got was just a few steps from "You can do this with code!" or "There's a method hidden in DirectX that does this, but I'm not going to tell you it's name. Have fun searching!"
|
|
|
|
|
|
I'm flattered that you thought I would think to search for "WMI process notification" based on the terms "What's the best way to detect the launch of an exe." I accept your pronouncement of my wisdom. I'm feeling better already...
Admit that you failed to answer the "best practices" core of my question. Admit it!!
Oh, and thanks for the links.
|
|
|
|
|
Hey, that "Thanks" may have looked snarkey, but it wasn't meant to be. Truly, actually, thanks for the info. It looks like this is exactly what I want.
Is there a more appropriate place to ask my "Best Practices" question?
|
|
|
|
|
Is there a way to force my C# app to display in XP default style(luna) even if windows classic style, or other style is chosen?
|
|
|
|
|
the same way WMP11 forces a vista style titlebar. Write your own UI directly to a graphics buffer instead of using the provided win32 items. You can earn the undieing hatred of everyone who configures their UI differently than the default fisherprice look because your app insists on clashing with it.
Otherwise [Microsoft is] toast in the long term no matter how much money they've got. They would be already if the Linux community didn't have it's head so firmly up it's own command line buffer that it looks like taking 15 years to find the desktop.
-- Matthew Faithfull
|
|
|
|
|
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
|
|
|
|