|
Hi
I had an instance XmlSchema class, and now wont to get an elemetn which
included in this schema by one ID (without iteration over all document), how i can do this.
And else how i can to get corresponded XmlDocument object for this XmlSchema object,when i see my instance in "watch view" i watch what this schema has Document property but i can't get acess to one due to protection level.
THANK.
|
|
|
|
|
Hi all
I need to access an Excel workbook and update certail cells and then print it. I want to use C# to access and update the Excel workbook. I can access it no problem using the ADO method and Microsoft.Jet. However I am struggling to update a specific named cell using the Update sql statement from my C# windows application.
Unfortunately the type of data is more fitting for a spreadsheet type layout, otherwise I would have used a database.
Can anyone assist me in this matter.
Thank you
kobus
|
|
|
|
|
I am trying to open a file from c:\windows\assembly, using opneFileDialog but it does not open it, other files are opened very easily.Why?
|
|
|
|
|
I am not familiar with that but I doubt that c:\Windows\Assembly or c:\winnt\assembly contains any files. It is the global assembly cache, isn't it?
So if you want to open an assembly, try looking in C:\WINNT\Microsoft.NET\Framework\v1.1.4322 or C:\Windows\... and the version of your choice if you installed more than one version of the .NET Framework (ie .net framework 1.0/1.1/2.0).
|
|
|
|
|
Hi ,
I want to compare the text of two html pages and then highlight the changed text.Do you have any idea on how to do this
|
|
|
|
|
hi all, hope some one can help me iv got a bit of a prob.
iv got a server and client sending data using sockets and tcp/ip.
The client sends the server some text and the server gets the byte[] array and then converts it into a string.
For the most part it is ok, however there are some characters it can not convert. i am using System.Text.ASCIIEncoding.ASCII.GetString() to turn the byte array into a string.
an example of a character it will not convert is §.
any help would be grate.
Thx
|
|
|
|
|
The character is not an ASCII character. Try System.Text.UnicodeEncoding.Unicode.GetString
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I have created a Windows Form that allows the user to enter a couple of file names, and select a couple of checkbox styled options. I have placed "Browse" buttons by the textbox that holds a filename. When Browse is selected, the OpenFileDialog is displayed. This all works like I expect. However, when I select Open in the OpenFileDialog, it runs the additional code in the Browse_Click method, then returns to the calling form. This is not what I want; I only want it to return when the user selects the AcceptButton or the CancelButton.
The code that shows the form in question:
<br />
formImportDatabase frmImport = new formImportDatabase();<br />
DialogResult dr = frmImport.ShowDialog();<br />
if (DialogResult.OK == dr)
{<br />
...<br />
}<br />
The Browse_Click code:
<br />
if (DialogResult.OK == openFileDialog.ShowDialog())<br />
{<br />
textBoxDestinationDB.Text = openFileDialog.FileName;<br />
} <br />
How can I keep the dialog box displayed until the AcceptButton or CancelButton is selected?
Thanks,
Glenn
|
|
|
|
|
I've had this problem recently - the trouble is that if your form is set to close on Accept or Cancel messages, a child form that closes with those messages will close your form as well. Get rid of all automatic form closure handling in your dialog, handle the click for OK and Cancel, and set DialogResult manually before calling this.Close();.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks. That did the trick, once I went into the generated source and remove the DialogResult.Cancel that had been placed in the browse button section.
Thanks again.
--G
|
|
|
|
|
It is like Christian said. But if I remember correctly you can also set the DialogResult in the BrowsClick event manually to override this nasty behaviour:
public void Browse_Click(object sender, EventArgs args) {
if (DialogResult.OK == openFileDialog.ShowDialog())
{
textBoxDestinationDB.Text = openFileDialog.FileName;
}
base.DialogResult = DialogResult.None;
}
|
|
|
|
|
Hmmm. I've already implemented Christian's suggestion and it works. I tried what you have above, with the exception of base.DialogResult = DialogResult.None. I'll keep that in mind for future forms. Thanks very much, if I had seen this sooner, it would have resulted in less work for me!
--G
|
|
|
|
|
To be more specific, I need the code for a text editor / RTF editor that I'm working on and I'm more than a little bit new at this coding thing, so I'm not too certain as to where to look for good clean snippets that provide the functionality that I need. I'd try to write the code myself, but I have at the moment a lack of two things: Time, since I've joined the Naval Reserve, and am studying a lot - and appropriate knowledge, since C# is essentially my first programming language since the "good ol' days" of Level 2 BASIC (anyone out there remember that one?).
Anyhoo, any help than you can all provide would be greatly appreciated.
Specific functionality that I'm trying to implement, but haven't found a clue to:
Global search and replace among all documents in an MDI environment.
Specific search and replace on a per-document basis.
Undo/redo functionality for both of the previous cases would also be good.
Thanks in advance for any help, and if you provide code, you'll be appropriately credited
B Turner
Some say that ignorance is bliss... Blissful, aren't they?
|
|
|
|
|
The string class has search and replace methods, that is, if your text is one big string, you can use the replace method to do search and replace, or you can use other methods to find the strings without replacing.
I'm not sure how to iterate through all documents in an MDI app, but I'm sure google can help here.
The easiest way to do undo is to make a copy of your document in memory before each action and push them on to a stack. If you want to only store the differences between documents to save memory ( no need with text, I would think ), then you need to get a little more complex.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
I'm not sure how to iterate through all documents in an MDI app,
foreach(Form form in this.MdiChildren)
{
TextDocumentForm textForm = form as TextDocumentForm;
if(textForm != null)
{
}
}
Now you know!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
I would place this code into the MdiParent, right?
Something tells me that that's the only logical place to put it, but I wanted to be sure.
Thanks again
Brian Turner
|
|
|
|
|
Yes, only an MDI parent window (IsMdiParent property set to true ) can have MDI children.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
I think that what I need is a code snippet, know of any good places to get that? Reason being is I learn better by having something to emulate. I'm still learning how to implement various classes. I'll post the code that I have so far, when I am able, so that you can all have something to chuckle at
Thanks for the help
Brian Turner
Some say that ignorance is bliss... Blissful, aren't they?
|
|
|
|
|
string theDocument = LoadString(); // This method does not exist, you need to get the text of the document
theDocument.Replace("oldstring", "newString");
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi guys,
Is there anyway I can load and view fonts that are not in the font folder? Scenario, I want to open and browse 3 or four differing folders on my computer with different fonts that I don' want to install till I've seen all of them. And being able to print them is a bonus...!
Cheers for any pointers,
Enumerating system fonts is easy....
|
|
|
|
|
|
Given a table name (e.g. CUSTOMERS), how do I get column names of the table and the data types of the columns the table has?
I am using SQLServer and would like to get that info from my C# code.
|
|
|
|
|
|
Or something similar?
|
|
|
|
|
Well you could say what spawnlp does... it would save me from googling.
Take a look at Process Class[^]
David
|
|
|
|