Once again - No. It cannot be done using an Excel object.
Excel does not have the ability to merge changes from multiple sources at the same time. If you got multiple instances to open the same workbook, then both apps made different changes to the workbook, the last one to save it's changes wins, completely overwriting everything else that was changed in previous saves by the other copies of the app.
So, if Instance1 opened the workbook and Instance2 open the same workbook, both instances would have their own copy of the data. Now, if Instance1 changed cell A1 and Instance2 changes cell B1, then they both saved, but Instance2 saved last, the only change you'd see in the workbook would be that to cell B1. Cell A1 wouldn't have changed from the original workbook.
Use a real database engine and if you need that data in an Excel sheet, have a tool that exports the data into a workbook so you have a point-in-time copy of the data in Excel.
Dave Kreskowiak Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
i want to update my application with a prompt for that.
i found Clickonce is very good, and tried alot to understand,
see could able to publish and make the new versions,
but my requirement is whenver user opens my applicaions and connected to internet i need to promt him saying u r working with olderversio(1.0 and current version 3.0 is available)
if user clicks ok it should be updated please
help me how to do so
thnx in advance
This info must be available in lots of places, but here it goes (in short)...
To publish the initial application:
1. Right click on the Project in solution explorer. Click Properties. Click the Publish tab.
2. Enter the location you want to publish to in 'Publishing location'
3. Click the 'Updates' button.
4. Check the 'Application should check for updates' checkbox.
5. Check the 'Before the application starts' radio button.
6. Click OK to close the dialog.
7. Back on the main screen, select 'The application is available offline as well'
8. Enter your initial publish version under 'Publish Version'
9. Click the 'Publish Now' button.
To publish an update:
If you want to publish an optional update, just increment the 'Publish Version' and click the 'Publish Now' button. When starting the application the user will be prompted if the update should be installed. The user has the option to skip the update.
If you want to publish a required update, increment the 'Publish Version'; then, click the 'Updates' button. In the dialog, check the 'Specify a minimum required version for...' checkbox. Enter the same version you just entered in 'Publish Version'. Click OK to close the
dialog. On the main screen, click the 'Publish Now' button. The update will automatically install as soon as the user starts the application.
appDeploy.CheckForUpdateProgressChanged += new DeploymentProgressChangedEventHandler(appDeploy_CheckForUpdateProgressChanged);
appDeploy.CheckForUpdateCompleted += new CheckForUpdateCompletedEventHandler(appDeploy_CheckForUpdateCompleted);
appDeploy.UpdateProgressChanged += new DeploymentProgressChangedEventHandler(appDeploy_UpdateProgressChanged);
appDeploy.UpdateCompleted += new AsyncCompletedEventHandler(appDeploy_UpdateCompleted);
yes i am sure, i've selected 'The application is available offline as well'
and can u please help me , how to work with Deployment.[ApplicationDeployment appDeploy = ApplicationDeployment.CurrentDeployment;]
i couldn't create instance to ApplicationDeployment ,
please tell me whatz all the credentials needed to create an instance to ApplicationDeployment .
thnx in advance
The ApplicationDeployment class does not have a constructor, so you can't create an instance of it. The only way to get an instance is to use the static CurrentDeployment property.
No offense, but I do suggest you start looking at the documentation rather than asking basic questions like this on the forum. The forum really is meant to get answers to things you can't readily figure out from the documentation.
The entire .NET framework documentation is available online. See for example:
I have to tables that I have joined together in sqlserver and I am trying to pull columns from both. However, myReader only picks up the first table's columns and i cannot retrieve any columns from the second table. How do I retrieve columns from multiple tables? Here's what I've got. Also is there just a way to type in the column names when retrieving data as opposed to specifying the column id. All suggestions welcome. thanks.
Yeah, it's possible to bring back the data by name but not the way you are doing it unfortunately. Not sure why MS do things this way but if you use:
agencyphone = myReader["YourFieldName"].ToString(); it should work (it's fine for strings but a pain for other datatypes)
I'm not sure why you only get one table's worth of fields back in the query, what does it do when run in query analyser /SQL Management Studio?
Depending on how many rows you have in each table and the width of the table it is often worth using DataRelations in a dataset to join on the client side, this can reduce the weight of data that you pull down the wire consderably.
I have been working on a Windows forms application that lets you list active user sessions on a server/pc.
From there it will allow to :-
connect to a user using vnc/rdp/etc
Log off user
Kill remote running programs/processes
Connect to drive(s) of local machine
Connect to users home folder
List various WMI classes on the PC that user is connected to
I could list more.
But, I am trying to gauge how much interest there might be from others in helping out on an open source c# project that will utilize Windows Forms(using GridView/ListView heavily), WMI and Active directory. That will create a tool that can manage PCs/Users without the need to install local agents (although this may be added later).
I have written the code for all of the above functions already and I have lots of other functions/features to add.
It would be really great if there was any interest from someone in the community to help me develop this application further as an open source project.
This isn't really a good place to ask this question, since it's not a specific C# related programming question; maybe try under Collaboration, but I suggest either just creating a SourceForge.net project or put it up on CodePlex and go from there ...
You could always, after posting it to one of those two boards, come back and announce the project via your "CP Blog".
I have a class1 and in one of its methods I created a local instance of class2 passing to its ctor a member var of class1.
Within class2 I modified the parameter passed to its ctor. To my surprise when I returned to class1 its member var was also modified? C++ wouldve handled this as a local var within class2. What's going on here?
you are passing a reference to the object by value, not the object itself by value. This has often been a source of confusion as it appears at first that value types and reference types behave differently. If you used a struct instead i suspect you would see the behaviour you were expecting.
It's one of those things that is very hard to explain so i'm not going to try right now as I'll probably just confuse the issue. There are a couple of articles around the place if you google for something like 'c# reference pass type by value' or similar you should find a more eloquent description of what's happening than i could provide.