Click here to Skip to main content
15,905,590 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to search a pdf file on web Pin
Pete O'Hanlon26-Sep-13 20:37
mvePete O'Hanlon26-Sep-13 20:37 
QuestionHow to Set the column of excel as bold while importing from datatable Pin
superselector26-Sep-13 3:37
superselector26-Sep-13 3:37 
AnswerRe: How to Set the column of excel as bold while importing from datatable Pin
Richard MacCutchan26-Sep-13 4:31
mveRichard MacCutchan26-Sep-13 4:31 
AnswerRe: How to Set the column of excel as bold while importing from datatable Pin
Chris Quinn26-Sep-13 5:09
Chris Quinn26-Sep-13 5:09 
GeneralRe: How to Set the column of excel as bold while importing from datatable Pin
superselector26-Sep-13 19:21
superselector26-Sep-13 19:21 
GeneralRe: How to Set the column of excel as bold while importing from datatable Pin
Chris Quinn26-Sep-13 21:41
Chris Quinn26-Sep-13 21:41 
QuestionNeed help with datatable Pin
superselector26-Sep-13 1:23
superselector26-Sep-13 1:23 
AnswerRe: Need help with datatable Pin
Gergo Bogdan26-Sep-13 1:58
Gergo Bogdan26-Sep-13 1:58 
GeneralRe: Need help with datatable Pin
superselector26-Sep-13 2:09
superselector26-Sep-13 2:09 
GeneralRe: Need help with datatable Pin
Gergo Bogdan26-Sep-13 3:03
Gergo Bogdan26-Sep-13 3:03 
GeneralRe: Need help with datatable Pin
superselector26-Sep-13 3:31
superselector26-Sep-13 3:31 
AnswerRe: Need help with datatable Pin
Ron Nicholson26-Sep-13 3:41
professionalRon Nicholson26-Sep-13 3:41 
QuestionGet Images from scanner in c# Pin
sanket16425-Sep-13 21:49
sanket16425-Sep-13 21:49 
AnswerRe: Get Images from scanner in c# Pin
Pete O'Hanlon25-Sep-13 22:39
mvePete O'Hanlon25-Sep-13 22:39 
QuestionProblem using DataContractSerializer Pin
larsp77725-Sep-13 4:27
larsp77725-Sep-13 4:27 
AnswerRe: Problem using DataContractSerializer Pin
Member 424999726-Sep-13 20:22
Member 424999726-Sep-13 20:22 
GeneralRe: Problem using DataContractSerializer Pin
larsp77726-Sep-13 21:53
larsp77726-Sep-13 21:53 
GeneralRe: Problem using DataContractSerializer Pin
Member 424999726-Sep-13 23:26
Member 424999726-Sep-13 23:26 
GeneralRe: Problem using DataContractSerializer Pin
larsp77727-Sep-13 1:10
larsp77727-Sep-13 1:10 
GeneralRe: Problem using DataContractSerializer Pin
Member 424999727-Sep-13 2:00
Member 424999727-Sep-13 2:00 
GeneralRe: Problem using DataContractSerializer Pin
larsp77727-Sep-13 2:02
larsp77727-Sep-13 2:02 
QuestionUnable to cast COM object of type 'mshtml.HTMLDocumentClass' to class type 'System.Windows.Forms.HtmlDocument'. Pin
Member 881108925-Sep-13 1:02
Member 881108925-Sep-13 1:02 
Hi guys,

I have the above error, it errors on the first line of my code:

C#
HtmlDocument doc = (HtmlDocument)Enquiry_Sourcing_Netcomponents.Document;

            doc.GetElementById("Session_Username").SetAttribute("value", "XXXXX");
            doc.GetElementById("Session_Password").SetAttribute("value", "XXXXX");
            doc.GetElementById("").InvokeMember("click");

            HtmlElementCollection theElementCollection = doc.GetElementsByTagName("input");

            HtmlElementCollection elems = doc.GetElementsByTagName("input");

            foreach (HtmlElement elem in theElementCollection)
            {
                String nameStr = elem.GetAttribute("name");
                if (nameStr != null && nameStr.Length != 0)
                {
                    String contentStr = elem.GetAttribute("content");
                    System.Windows.MessageBox.Show("Document: " + Enquiry_Sourcing_Netcomponents.ToString() + "\nDescription: " + contentStr);
                }
            }



Any ideas?
AnswerRe: Unable to cast COM object of type 'mshtml.HTMLDocumentClass' to class type 'System.Windows.Forms.HtmlDocument'. Pin
Richard MacCutchan25-Sep-13 1:45
mveRichard MacCutchan25-Sep-13 1:45 
AnswerRe: Unable to cast COM object of type 'mshtml.HTMLDocumentClass' to class type 'System.Windows.Forms.HtmlDocument'. Pin
BillWoodruff25-Sep-13 3:09
professionalBillWoodruff25-Sep-13 3:09 
GeneralRe: Unable to cast COM object of type 'mshtml.HTMLDocumentClass' to class type 'System.Windows.Forms.HtmlDocument'. Pin
Member 881108925-Sep-13 5:00
Member 881108925-Sep-13 5:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.