<%
do While Not rsRecord.EOF
%>
<tr bgcolor=
<%
RecordCounter = RecordCounter + 1
If RecordCounter Mod 2 = 1 Then
Response.Write "#CCCC66"
Else
Response.Write "#CCEE66"
End If %>
class="bcrumb" align="center">
<td>
Student<%=(rsRecord.Fields.Item("id").Value)%>
</td>
<td>
<%
Dim rsPolarity
Dim rsPolarity_numRows
Set rsPolarity = Server.CreateObject("ADODB.Recordset")
rsPolarity.ActiveConnection = school
rsPolarity.Source = "SELECT name FROM dbo.student WHERE id="&rsRecord("class")
rsPolarity.CursorType = 0
rsPolarity.CursorLocation = 2
rsPolarity.LockType = 1
rsPolarity.Open()
rsPolarity_numRows = 0
%>
<div align="center"><%=(rsPolarity.Fields.Item("name").Value)%></div>
</td>
in asp i can control which field i want to display and also control the <tr><td> like above.
what should i do in asp.net vb language to do the similiar function where i can control or continue to add new row and specifies which attribute data to be displayed like above?
what i want is to display the data from the sql into a table where i can control the field to be displayed and the row color to be displayed. the sql will return multiple rows of data and at the middle of the retireving the rows of data i need to use the data to retrieve another sql to obtain another attribute value from different table and display the value before going to another rows or next value. like what in the asp code above i can retrieve rows by rows and use the retrieved data at the middle of the process to get other value and displayed it before going to the next value of the first process or next row of the first process. i not really sure about this could any one help me out with this?
You could fill a DataTable, then loop through its DataRows and fire off a new query for each of them if you need. Although in that case it might be more effective to use a join in the database?
could you show me how to do that?and if i put in the data table will the results be displayed to the user view before i can process it? cause if it is displayed first to the user it will be untidy right?
please show me also how i can create the table dynamically using the asp.net vb to control of the field width and which attribute to go to which field.
JOHN
i am new to this asp.net enviroment and i want to learn about it
could you show me how to fill a DataTable, then loop through its DataRows and fire off a new query for each of them
Public Function SelectSqlSrvRows(dataSet As DataSet, connection As String, query As String) As DataSet
Dim conn As New SqlConnection(connection)
Dim adapter As New SqlDataAdapter()
adapter.SelectCommand = new SqlCommand(query, conn)
adapter.Fill(dataset)
Return dataset
End FunctionDataAdapter Class.
if i am not mistaken this function only bind the data into the dataset right? how do i change the value in the dataset? i mean only some colums value before displaying the data to the user view