Click here to Skip to main content
15,867,308 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionVb.net FlowLayoutPanel with MS Access: System.InvalidCastException error. Pin
sdfsdfsdfewrew3feff26-Feb-23 6:37
sdfsdfsdfewrew3feff26-Feb-23 6:37 
AnswerRe: Vb.net FlowLayoutPanel with MS Access: System.InvalidCastException error. Pin
Richard Deeming26-Feb-23 22:31
mveRichard Deeming26-Feb-23 22:31 
GeneralRe: Vb.net FlowLayoutPanel with MS Access: System.InvalidCastException error. Pin
sdfsdfsdfewrew3feff27-Feb-23 6:55
sdfsdfsdfewrew3feff27-Feb-23 6:55 
GeneralRe: Vb.net FlowLayoutPanel with MS Access: System.InvalidCastException error. Pin
Richard Deeming27-Feb-23 21:17
mveRichard Deeming27-Feb-23 21:17 
AnswerRe: Vb.net FlowLayoutPanel with MS Access: System.InvalidCastException error. Pin
Dave Kreskowiak27-Feb-23 3:14
mveDave Kreskowiak27-Feb-23 3:14 
GeneralRe: Vb.net FlowLayoutPanel with MS Access: System.InvalidCastException error. Pin
sdfsdfsdfewrew3feff27-Feb-23 8:36
sdfsdfsdfewrew3feff27-Feb-23 8:36 
AnswerRe: Vb.net FlowLayoutPanel with MS Access: System.InvalidCastException error. Pin
jschell13-Mar-23 6:30
jschell13-Mar-23 6:30 
QuestionXML view to display in grid view Pin
Member 1592502915-Feb-23 5:30
Member 1592502915-Feb-23 5:30 
----The Sample XML File
<AuditResult name="Server Baseline" created="2/14/2023 3:16:19 AM" type="Assessment run by Administrator">
<Section name="Operating System" state="Compliant" further-state="">
<Result name="Computer Name" type="report">DEVSTUDIO </Result>
<Result name="Operating System" type="report">Microsoft Windows Server 2008 R2 Standard </Result>
</Section>
<Section name="Operating System (Windows Server 2008 R2)" state="Not Compliant" further-state="">
<Result name="System Partition" type="compliance" state="Compliant" further-state=""> </Result>
<Result name="Role & Feature - .NET Framework" type="compliance" state="Compliant" further-state=""> </Result>
<Result name="Windows Firewall - Private Profile Off" type="compliance" state="Compliant" further-state=""> </Result>
<Result name="Windows Firewall - Domain Profile Off" type="compliance" state="Compliant" further-state=""> </Result>
</Section><code></code>
</AuditResult>
------------------
The above is my xml file, i am using dataset to populate in the gridview i am able to get the child node information but along with parent i am unable to do it. PFB the code

Dim Opf As New OpenFileDialog()
Opf.Filter = "XML File | *.xml"
Opf.FileName = ""
If Opf.ShowDialog() = DialogResult.OK Then

Dim fcontent As String
Dim fpath As String
fpath = Opf.FileName
Using sr As StreamReader = New StreamReader(fpath)
DataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells
DataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells
DataGridView1.DefaultCellStyle.WrapMode = DataGridViewTriState.True
fcontent = sr.ReadToEnd
'MsgBox(fcontent)

Dim sfcontent As StringReader
sfcontent = New StringReader(fcontent)

Dim doc As XmlDocument = New XmlDocument()
doc.Load(sfcontent)

Dim naudit As XmlNode = doc.SelectSingleNode("/AuditResult/@name")
Dim naudita = naudit.InnerText
nlblaudit.Text = naudita

Dim nauditc As XmlNode = doc.SelectSingleNode("/AuditResult/@created")
Dim naudit1 = nauditc.InnerText

Dim nauditb As XmlNode = doc.SelectSingleNode("/AuditResult/@type")
Dim naudit2 = nauditb.InnerText
nlblauditcreated.Text = naudit2 & " - Created" & " : " & naudit1


Dim ds As New DataSet()
ds.ReadXml(New StringReader(fcontent))
DataGridView1.DataSource = ds.Tables(2)


For i As Integer = 0 To Me.DataGridView1.Rows.Count - 1
If Not IsDBNull(Me.DataGridView1.Rows(i).Cells(2).Value) Then
If Me.DataGridView1.Rows(i).Cells(2).Value = "Compliant" Then
Me.DataGridView1.Rows(i).DefaultCellStyle.BackColor = Color.LightGreen
ElseIf Me.DataGridView1.Rows(i).Cells(2).Value = "Not Compliant" Then
Me.DataGridView1.Rows(i).DefaultCellStyle.BackColor = Color.LightPink
End If
End If

Next

End Using

End If
QuestionSystem.Design - Not enough memory resources Pin
JoshWilliams5-Jan-23 10:37
JoshWilliams5-Jan-23 10:37 
AnswerRe: System.Design - Not enough memory resources Pin
Dave Kreskowiak5-Jan-23 14:25
mveDave Kreskowiak5-Jan-23 14:25 
GeneralRe: System.Design - Not enough memory resources Pin
trønderen5-Jan-23 15:09
trønderen5-Jan-23 15:09 
GeneralRe: System.Design - Not enough memory resources Pin
Dave Kreskowiak5-Jan-23 15:35
mveDave Kreskowiak5-Jan-23 15:35 
GeneralRe: System.Design - Not enough memory resources Pin
trønderen5-Jan-23 17:54
trønderen5-Jan-23 17:54 
GeneralRe: System.Design - Not enough memory resources Pin
Eddy Vluggen5-Jan-23 23:55
professionalEddy Vluggen5-Jan-23 23:55 
GeneralRe: System.Design - Not enough memory resources Pin
Pete O'Hanlon6-Jan-23 2:11
subeditorPete O'Hanlon6-Jan-23 2:11 
GeneralRe: System.Design - Not enough memory resources Pin
Dave Kreskowiak6-Jan-23 11:44
mveDave Kreskowiak6-Jan-23 11:44 
GeneralRe: System.Design - Not enough memory resources Pin
jschell10-Jan-23 6:46
jschell10-Jan-23 6:46 
GeneralRe: System.Design - Not enough memory resources Pin
Dave Kreskowiak10-Jan-23 6:47
mveDave Kreskowiak10-Jan-23 6:47 
GeneralRe: System.Design - Not enough memory resources Pin
jschell15-Jan-23 7:40
jschell15-Jan-23 7:40 
GeneralRe: System.Design - Not enough memory resources Pin
Dave Kreskowiak15-Jan-23 8:07
mveDave Kreskowiak15-Jan-23 8:07 
GeneralRe: System.Design - Not enough memory resources Pin
trønderen15-Jan-23 12:29
trønderen15-Jan-23 12:29 
GeneralRe: System.Design - Not enough memory resources Pin
Dave Kreskowiak15-Jan-23 13:50
mveDave Kreskowiak15-Jan-23 13:50 
AnswerRe: System.Design - Not enough memory resources Pin
Randor 5-Jan-23 16:10
professional Randor 5-Jan-23 16:10 
AnswerRe: System.Design - Not enough memory resources Pin
jschell10-Jan-23 7:05
jschell10-Jan-23 7:05 
GeneralRe: System.Design - Not enough memory resources Pin
jochance7-Mar-23 9:26
jochance7-Mar-23 9:26 

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.