Dear Sir/Madam
I would linke you to help me as below:
I want to using datareader and inside datareader I have datareader but I cannot.
I using code as below but error can you help me.
thanks
Kosal
I would linke you to help me as below:
I want to using datareader and inside datareader I have datareader but I cannot.
I using code as below but error can you help me.
Code:
Dim Category As String = "SELECT catgcode, catgName FROM tblCategories"
Dim myCommand As New System.Data.SqlClient.SqlCommand(Category, DBTools.gCnn)
Dim myReader As System.Data.SqlClient.SqlDataReader=Nothing
myReader = myCommand.ExecuteReader()
While myReader.Read()
Response.Write("<li><span class='folder'> "& myReader("catgName") &"</span>")
Dim subCategory As String = "SELECT subCatgCode, subCatgName FROM tblSubCategories WHERE catgcode='"& myReader("catgCode")
Dim myCommand1 As New System.Data.SqlClient.SqlCommand(subCategory, DBTools.gCnn)
Dim myReader1 As System.Data.SqlClient.SqlDataReader
myReader1 = myCommand1.ExecuteReader()
While myReader1.Read()
Response.Write("<ul>")
Response.Write("<li><span class='file'> "& myReader1("subCatgName") &"</span></li>")
Response.Write("</ul>")
End While
myReader1.Close()
Response.Write("</li>")
End While
myReader.Close()
myReader=Nothing
DBTools.gCnn.Close()
thanks
Kosal
Comment