Reply
Help in table manipulation in asp.net
Old 10-03-2007, 03:32 AM Help in table manipulation in asp.net
Skilled Talker

Posts: 65
Code:
 <%
 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?

thanks
leolim is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 10-03-2007, 03:41 AM Re: Help in table manipulation in asp.net
Skilled Talker

Posts: 65
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?

please show me how it can be done in asp.net

thanks
leolim is offline
Reply With Quote
View Public Profile
 
Old 10-03-2007, 01:41 PM Re: Help in table manipulation in asp.net
Learning Newbie's Avatar
Moderator

Latest Blog Post:
Dick Cheney as a Web Comic
Posts: 4,622
Name: John Alexander
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?

Look under the SqlClient namespace.
__________________
4 ways to improve the lives of the "bottom billion"

"HEY YOU KIDS GET OFF MY LAWN!" -John McCain
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 10-03-2007, 07:54 PM Re: Help in table manipulation in asp.net
Skilled Talker

Posts: 65
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?

thanks
leolim is offline
Reply With Quote
View Public Profile
 
Old 10-03-2007, 07:58 PM Re: Help in table manipulation in asp.net
Skilled Talker

Posts: 65
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.

thanks again
leolim is offline
Reply With Quote
View Public Profile
 
Old 10-04-2007, 08:45 PM Re: Help in table manipulation in asp.net
Skilled Talker

Posts: 65
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

thanks
leolim is offline
Reply With Quote
View Public Profile
 
Old 10-05-2007, 06:22 PM Re: Help in table manipulation in asp.net
Learning Newbie's Avatar
Moderator

Latest Blog Post:
Dick Cheney as a Web Comic
Posts: 4,622
Name: John Alexander
Check out Microsoft's documentation on MSDN

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.

Using ADO.NET.
__________________
4 ways to improve the lives of the "bottom billion"

"HEY YOU KIDS GET OFF MY LAWN!" -John McCain
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 10-09-2007, 07:59 PM Re: Help in table manipulation in asp.net
Skilled Talker

Posts: 65
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

thanks

Last edited by leolim : 10-09-2007 at 08:00 PM.
leolim is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Help in table manipulation in asp.net
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.14685 seconds with 13 queries