|
I wasn't knocking you - honest!!;) It's good that people vote, and better when the answer voted for is quick, easy and importantly, correct.
I just think it is funny when two people post virtually the same answer to the question. I know it gives you, as the OP, more confidence the answer might be correct, but certain people (they know who they are!) do it just to get their post count up.
<edit>I'm digging a hole for myself now...I am not saying that J@@NS did this for the reasons above - the times are too close together. I think I better shut up whilst I am ahead, or at least not too far behind... lt;/edit>
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"I haven't spoken to my wife now for 48 hours. I don't like to interrupt her.
|
|
|
|
|
Hi
I want to create treenode and save those node as an xml file can any one please help.
Mamphekgo
|
|
|
|
|
I am writing a program that consists of several applications, some are client applications, one is the master application, all are standard Windows Forms apps. The clients can all be started seperatly by the user, or the master application starts them automaticly to have the standard user interaction of the client programs and also automated interaction / control with the master program. I would like to do the interaction by simply using public methods and events.
My question is now how do I start the client applications automaticly by the master to have this sort of access? Do I simply create a new instance of the clients main forms? Should I do this in seperate threads to avoid locking up the master program while the clients are working? Or do I have to somehow use Application.Run(), if so how do I do this? Are there any severe pitfalls I am missing?
Help would be appreciated,
Stephan
|
|
|
|
|
stephan.smolek wrote: The clients can all be started seperatly by the user, or the master application starts them automaticly to have the standard user interaction of the client programs and also automated interaction / control with the master program.
The only way to start the other applications is by using the Process class to launch them.
stephan.smolek wrote: also automated interaction / control with the master program
You cannot just expose public methods and expect to be able to call them acrossed AppDomain boundries. You're going to have to learn about .NET Remoting, or Windows Communication Foundation, and setup remoting servers and clients in your applications to handle the communication and you'll also have to carefully design your applications to expose their functionality through various object models, kind of like how Word and Excel do it.
|
|
|
|
|
hi all,
Can anyone knows how to capture the desktop of a remote machine and save it as an image. I have tried and able to capture my same system. But not able to capture the remote machine's desktop.
Thanks and regards
Anez.A
|
|
|
|
|
It cannot be done unless oyu have code running on the remote machine doing the capture and sending the data to your local "server" code.
You may want to Google for and look into "VNCSharp".
|
|
|
|
|
Thank you for ur information.
But, it can be done...
i have seen one application.
Anyway, i'l try to implement .....
|
|
|
|
|
The only possible way that could happen is if you used the built in RemoteDesktop stuff. That's only if it's installed and enabled on the target machine, and you if your credentials work on the target machine for connecting to it.
|
|
|
|
|
Hi all
I want to read a particular node of xml file. For that i am using the code
XmlTextReader reader = new XmlTextReader ("tx1.xml");
while (reader.Read ())
{
if(reader.IsStartElement ())
{
if (reader.NodeType == XmlNodeType.Element && reader.Name == "jid")
{
str=reader.ReadString();
Lblmsg.Visible=true;
Lblmsg.Text="journal ID <"+ reader.Name+ "> is : "+str;
reader.Read();
break;
}
break;
}
}
but here the problem is it is trying to validate the xml file using the DTD. I dont want to validate it using dtd. Plz help to solve this. what i have to use here. Plz help me thank u
|
|
|
|
|
I have a datatable named EmployeeDT. I am using hastable to store data. I want to to take an employeeID of EmployeeName from data table When i select Employee name in the combobox and add to HashTable.
I am binding data to combobox using this method
foreach(DataRow drow in EmployeeDT.Rows)
{
cboemployee1.Items.Add(drow["Name"].ToString().Replace("\"","\'"));
cboemployee2.Items.Add(drow["Name"].ToString().Replace("\"","\'"));
cboemployee3.Items.Add(drow["Name"].ToString().Replace("\"","\'"));
}
From this code how can i add key to the hash table...
|
|
|
|
|
Hashtable.Add(key, value)
Paul
|
|
|
|
|
No. Write it yourself. This is the best way to find solutions to problems, rather than relying on others.
Have you even read the .NET framework documentation? It shows you how to do it in there.
Paul
|
|
|
|
|
Who were you replying to?
God Bless,
Jason
I am not perfect but I try to be better than those before me.
So those who come after me will be better than I am.
|
|
|
|
|
I got the following reply from the OP
Can u write code according to my problem
I objected (reasonably) to having to do his work for him.
For some reason, his post didn't appear in the message thread...
Paul
|
|
|
|
|
I am currently working with a .Net web application. I have to create several complicated excel reports using that web application. I have two doubts
First Question:
Can I use all the excel functions with .Net ?
Do you have any good samples ?
Second Question:
This is not a windows application, this is a web server. Can I generate excel report by using .Net web application?
Thanks!
jayasshc
|
|
|
|
|
csecharithjayasshc wrote: First Question:
Can I use all the excel functions with .Net ?
Do you have any good samples ?
Do you need to include functions in your Excel spreadsheet? Or do you just need to output a set of literal values to it? If you just need to output data to your spreadsheet you should look at using the ODBC/Jet driver. Google will provide you with plenty of samples. If you need to create functions for particular cells, then you will need to use the Excel automation library. Again, Google should be your starting point.
csecharithjayasshc wrote: Second Question:
This is not a windows application, this is a web server. Can I generate excel report by using .Net web application?
Yes you can, but of the two options I mentioned above I would only recommend using the ODBC/Jet solution from a web application. Excel has a single-threaded architecture, so the automation library is not suited for use within a server application.
Regards
Paul
|
|
|
|
|
Dear Paul,
Thank you very much for the reply.
I just noticed another more important fact. I'll receive all the required data through a stored procedure. So I don't want to use excel functions, I can calculate everything in C# and post the calculated value on the cell.
So "Excel automation library" would be suitable for that, isn't it?
Thanks Again!
|
|
|
|
|
Yes, but you're still better off using the ODBC/Jet driver rather than Excel automation for the reasons I mentioned in my previous post. This is what I recently used when creating a data export facility for an ASP.NET web app.
Paul
|
|
|
|
|
Hi,
ok, is ODBC/Jet driver functionality depends on the excel version (2003 or 2007)?
Thanks!
|
|
|
|
|
No. You don't need Excel installed on the server, only the driver.
Paul
|
|
|
|
|
Hi Paul,
Could you please provide me a good C# example for odbc/jet driver thing?
I tried on the internet but still I couldn't find a proper one. I could find several nice article for "Excel Automation Library".
Thanks for your kind help!
Good Luck!!!
jayasshc
|
|
|
|
|
Try something like this:
string dataFile = "<path to your excel file>";
File.SetAttributes(dataFile, FileAttributes.Normal);
System.Data.OleDb.OleDbConnection tempExcelConnection = new System.Data.OleDb.OleDbConnection();
tempExcelConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;";
tempExcelConnection.ConnectionString += "Data Source=" + dataFile + ";";
tempExcelConnection.ConnectionString += @"Extended Properties=""Excel 8.0;HDR=Yes;"";";
System.Data.OleDb.OleDbCommand tempExcelCommand = new System.Data.OleDb.OleDbCommand();
tempExcelCommand.Connection = tempExcelConnection;
System.Data.SqlClient.SqlDataReader dr = null;
tempExcelCommand.Connection.Open();
if (dr.HasRows)
{
while(dr.Read())
{
tempExcelCommand.CommandText = String.Format("INSERT INTO [mynamedrange] VALUES ({0}, {1}, {2}, {3}, {4})", dr[0], dr[1], dr[2], dr[3], dr[4]);
tempExcelCommand.ExecuteNonQuery();
}
}
dr.Close();
tempExcelCommand.Connection.Close();
Regards
Paul
|
|
|
|
|
This article shows you another approach: http://www.bbv.ch/pdf_files/system_event/2005_XMLto%20Excel.pdf
XSLT is used to create Excel files.
The advantage is that you do not need Excel itself to create the files.
The disadvantage is that you have a Excel-xml file in the end. If you need to have an xls then you still have to use Excel to transform the xml to a xls file. But this is mus easier then program all data into Excel with interop.
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
|
Hi,
if you are looking for a solution for a large project, you should evaluate the libraries offered by aspose http://www.aspose.com[^]. I started a project using COM/INTEROP to create an interface to the office world. Then it was necessary to support the generation of word documents on a server without having any MS office application installed. We decided to use aspose. Finally we were able to improve our applications noticeably.
Erik
|
|
|
|