|
You could use attributes, but the code can be verbose and (perhaps) inefficient.
I'd stick with the readonly static Dictionary idea; wrap it in something so the code that uses it can't change it.
|
|
|
|
|
I thought that this is the only way.
It strange that such a powerful language don't have this simple features.
Thanks for your help.
Sincerely yours
Y.R.
|
|
|
|
|
Microsoft tends to do the hard stuff and leave the easy stuff to you. (Which is better than the other way around.)
|
|
|
|
|
How to load HTML file using XmlDocument class
I try to do
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.Load(path);
but html document not considered by doc.Load method like regullar xml document since what have some unclosed tags such as an other unwell formated things(<link)>Can i actually load this html file by using System.Xml.XmlDocument() for purpose transform this HTML file into an XML file by using XSLT.
THANK
|
|
|
|
|
As you have found, not all HTML documents are XHTML. Therefore, a DOM class will not load them. An XSLT can generate non XML documents, but it cannot work with documents that are not XML to start with, you need a different solution.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
HTML doesn't conform to XML standards. However XHTML does. The following text comes from the Wikipedia article for XHTML:
Whereas HTML is an application of Standard Generalized Markup Language (SGML), a very flexible markup language, XHTML is an application of XML, a more restrictive subset of SGML.
A solution to your problem would be to convert your HTML code to XHTML which can be understood by the XML parser. I'm not aware of a component that can do this. However this article[^] explains the processes involved.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Personally, I do use SgmlReader[^].
In addition you could use my Zeta Html Tidy[^] library.
I am using both, SgmlReader andy Zeta Html Tidy, together in some projects.
|
|
|
|
|
|
hi
i have datagrid, i pick some records (CTRL + rows)
i want to run over the datagrid and to read only the
rows that i pick
how can i do this ?
thank's for any help
|
|
|
|
|
|
I use below code to fill the DataAdapter with a table contents, but the table name contain space such as "Table Name" I am using replace method to elemnate space from the table name to become "TableName" because when filling DataAdapter it returns an error and even with using the replace method I receive an error such "Syntax error in query. Incomplete query clause."
private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
{
DataSet1 ds = new DataSet1();
string stconn = "connection string";
OleDbConnection conn = new OleDbConnection(stconn);
string deletespace = this.treeView1.SelectedNode.Text.ToString();
string Deletespace = deletespace.Replace(" ","");
OleDbCommand command = new OleDbCommand("select * from '" + Deletespace.ToString() + "'", conn);
conn.Open();
OleDbDataAdapter Adapter = new OleDbDataAdapter();
Adapter.SelectCommand = command;
Adapter.Fill(ds, Deletespace.ToString());
}
hawari
|
|
|
|
|
Wow.
ahawari09 wrote: string Deletespace = deletespace.Replace(" ","");
Why create a new string ?
ahawari09 wrote: Deletespace.ToString()
What do you think 'ToString' does when called on a string ?
ahawari09 wrote: ("select * from '" + Deletespace.ToString() + "'", conn);
Why are you putting the table name in quotes ?
ahawari09 wrote: conn.Open();
OleDbDataAdapter Adapter = new OleDbDataAdapter();
Adapter.SelectCommand = command;
Adapter.Fill(ds, Deletespace.ToString());
Why don't you close the connection ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I am using treeview control to display table contents and when I duble click the selected node I display a spacific table contents in a listview control, to do that I have to pass table name which is the selected node.text to the select statment then to the DataAdapter. There is one problem table names should not contain space or it will not run without an error. So I am tring to remove space from node.text.
hawari
|
|
|
|
|
Wow. OK, this is a total disaster, not in least because you plainly have no idea. Buy a book on SQL and read it, please.
A table name NEVER goes in quotes, this is the source of your error. If a table name has spaces in it, in the database, you use [] to reference it, as in [my table with a stupid name]. I'd never use spaces to startwith, but leading and trailing spaces ( which you can remove with the Trim method if you like ) are not doing to stop the code from working.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Wow. I belive you are the one who has no idea, because you did not realy understand the problem. First of all I am not working with SQL server to produce the code I sent to you, I am working with C#. That is why you can see embedded SQL "with a stupid name" table goes in quotes. Thank you and please you don't have to reply to any of my questions.
Regards,
hawari
|
|
|
|
|
By the way, you don't have to use .Text for the table name. There's a tag of object type where you can "tag" the table name to, or in more complex case, you can tag a class object that contains the table name plus other information, ie the whole select statement, for example.
By, by the way, table name in SQL statement should not be enclosed by single quotes.
|
|
|
|
|
|
When right-clicking a file in Windows Explorer, e.g. a JPEG image, a list of possible applications is presented ("Open with" submenu).
Is it possible for my application to read this list for a certain file type, too?
I tried several different ways like the registry etc. but found no suitable way.
Thanks
Uwe
|
|
|
|
|
The registry is where they come from, although I've never looked at how to do it.
HKEY_CLASSES_ROOT\.jpg\Default is jpegfile.
HKEY_CLASSES_ROOT\jpegfile\shell\open\command seems to show the default open behaviour
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVErsion\Explorer\FileExts\.jpeg\OpenWithList seems to contain the list of programs that can open a JPEG.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thank you, Christian!
I still hope to find a more high-level way of doing this since security and portability issues are easier to handle then...
|
|
|
|
|
Yeah, I would hope there was a shell method you could p/invoke, but what I sent was just what I could find by digging around a little.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi All,
I am developing a Windows Forms 2.0 application. I have some questions on the DataGridView.
I have two Datagridviews on the form which I have populated from the the database tables customer_group, and group using the datasource wizard. The table group for the gridview contains columns GroupID int and Name varchar datatypes and the table customer_group contains customerID int, GroupID int, memberNumber int. I have a Cell_Click event on the first gridview and when I click on the button in the first gridview it should add the particular row into the second gridview which is customer_gridview. but it gives me the following error.
"Input string was not in a correct format"
Could you please give me some idea and some code examples. I really appreciate your help.
Here is the Cell_Clickevent
private void groupDataGridView_CellClick(object sender, DataGridViewCellEventArgs e)
{
//MessageBox.Show("Cell click");
if (e.ColumnIndex == 0)
{
this.customer_GroupTableAdapter.Insert(int.Parse(this.customerIDTextBox.Text),
int.Parse(this.groupDataGridView.Rows[e.RowIndex].Cells[1].Value.ToString()), null);
}
Koonda
|
|
|
|
|
Hi
I am looking to go for 70-316 certification.I need to get some free study material(dump) for that.
Any help would be great.
Until you realize this message has nothing to say, its too late to stop reading
|
|
|
|
|
Do it yourself.
"You posted your question here, indicating that you're so thick you couldn't find the VB Forum if it was licking your bung hole." - John Simmons / outlaw programmer
|
|
|
|
|
This is why certifications are useless
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|