Click here to Skip to main content
16,006,845 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionSetup and Deployment for .Net 1.1 question Pin
subir12322-Sep-06 4:23
subir12322-Sep-06 4:23 
AnswerRe: Setup and Deployment for .Net 1.1 question Pin
Dave Kreskowiak22-Sep-06 9:54
mveDave Kreskowiak22-Sep-06 9:54 
QuestionReading a two line text file into seperate textbox Pin
johnjsm22-Sep-06 4:06
johnjsm22-Sep-06 4:06 
AnswerRe: Reading a two line text file into seperate textbox Pin
Kschuler22-Sep-06 5:05
Kschuler22-Sep-06 5:05 
GeneralRe: Reading a two line text file into seperate textbox Pin
johnjsm22-Sep-06 9:45
johnjsm22-Sep-06 9:45 
GeneralRe: Reading a two line text file into seperate textbox Pin
johnjsm15-Jan-07 5:04
johnjsm15-Jan-07 5:04 
GeneralRe: Reading a two line text file into seperate textbox Pin
Kschuler15-Jan-07 5:33
Kschuler15-Jan-07 5:33 
QuestionError when populating DataSet Pin
Richard Segerlund22-Sep-06 3:31
Richard Segerlund22-Sep-06 3:31 
I have a sub that is constructed to gather information from a number of XML-files. The XML-files are located in subfolders to the folder where Im running the sub. I have an XML for every website and if I get this code to work I can easely se all information in one Gridview. I can'tget it to work. I get an error at the row with "newRow = dsAllData.Tables(0).NewRow()". The errormessage is: "The reference for an object is not referencing to an instance of an object.". Does anyone have an idea? Se my code under. Im stucked Sigh | :sigh: ! Thanks for all help!

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim pathToFolder As String = ""
'Get the number of folders in pathToFolder and place the paths in Dataset
Dim dsAllPaths(200) As String
Dim k As Integer = Nothing
Dim j As Integer = Nothing
Dim s() As String
s = System.IO.Directory.GetDirectories(Server.MapPath(pathToFolder))
Do
If File.Exists(s.GetValue(k) & "\info.xml") Then
dsAllPaths(j) = (s.GetValue(k) & "\info.xml")
j = j + 1
End If
k = k + 1
Loop Until k = s.GetUpperBound(0) + 1

'ReDim array
ReDim Preserve dsAllPaths(j - 1)

'Places the right data in dsAllData from the info-file
Dim dsAllData As DataSet = Nothing
Dim i As Integer = 0
Do
Dim ds As New DataSet()
ds.ReadXml(dsAllPaths(i))

Dim newRow As DataRow
newRow = dsAllData.Tables(0).NewRow()
newRow.Item("Caption") = ds.Tables(0).Rows(0).Item(0)
newRow.Item("Status") = ds.Tables(0).Rows(0).Item(1)
newRow.Item("Information") = ds.Tables(0).Rows(0).Item(2)
newRow.Item("Buggs") = ds.Tables(0).Rows(0).Item(3)
newRow.Item("Wish") = ds.Tables(0).Rows(0).Item(4)
newRow.Item("Keywords") = ds.Tables(0).Rows(0).Item(5)
newRow.Item("Folder") = Replace(dsAllPaths(i), Server.MapPath("info.xml"), "")
dsAllData.Tables(0).Rows.Add(newRow)
i = i + 1
Loop Until i = dsAllPaths.GetLength(0)

'Bind datasource to gridview1
GridView1.DataSource = dsAllData
GridView1.DataBind()
End Sub



Best regards Richard Segerlund

AnswerRe: Error when populating DataSet Pin
Kschuler22-Sep-06 5:13
Kschuler22-Sep-06 5:13 
QuestionIs it possible to add to My.Settings at runtime? Pin
TJO122-Sep-06 3:19
TJO122-Sep-06 3:19 
AnswerRe: Is it possible to add to My.Settings at runtime? Pin
MohammadAmiry23-Sep-06 1:30
MohammadAmiry23-Sep-06 1:30 
AnswerRe: Is it possible to add to My.Settings at runtime? Pin
TJO123-Sep-06 3:28
TJO123-Sep-06 3:28 
QuestionFile System Controls in VB for Excel Pin
manustone22-Sep-06 2:32
manustone22-Sep-06 2:32 
AnswerRe: File System Controls in VB for Excel Pin
Dave Kreskowiak22-Sep-06 3:17
mveDave Kreskowiak22-Sep-06 3:17 
GeneralRe: File System Controls in VB for Excel Pin
manustone22-Sep-06 4:51
manustone22-Sep-06 4:51 
QuestionPrinting from a website (ASP & JavaScript) Pin
nsr2006nsr22-Sep-06 2:16
nsr2006nsr22-Sep-06 2:16 
AnswerRe: Printing from a website (ASP & JavaScript) Pin
Dave Kreskowiak22-Sep-06 3:10
mveDave Kreskowiak22-Sep-06 3:10 
Question.Net Controls Postion Pin
Jhony91122-Sep-06 2:00
Jhony91122-Sep-06 2:00 
AnswerRe: .Net Controls Postion Pin
Dave Kreskowiak22-Sep-06 3:08
mveDave Kreskowiak22-Sep-06 3:08 
Questioninstallation headache Pin
ihe22-Sep-06 1:26
ihe22-Sep-06 1:26 
AnswerRe: installation headache Pin
Dave Kreskowiak22-Sep-06 3:05
mveDave Kreskowiak22-Sep-06 3:05 
GeneralRe: installation headache Pin
ihe25-Sep-06 5:23
ihe25-Sep-06 5:23 
GeneralRe: installation headache Pin
Dave Kreskowiak25-Sep-06 12:54
mveDave Kreskowiak25-Sep-06 12:54 
GeneralRe: installation headache Pin
ihe26-Sep-06 1:28
ihe26-Sep-06 1:28 
GeneralRe: installation headache Pin
Dave Kreskowiak26-Sep-06 2:09
mveDave Kreskowiak26-Sep-06 2:09 

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.