Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

.NET Forum


You are currently viewing our .NET Forum as a guest. Please register to participate.
Login



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

Posts: 65
Trades: 0
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
 
 
Register now for full access!
Old 10-03-2007, 04:41 AM Re: Help in table manipulation in asp.net
Skilled Talker

Posts: 65
Trades: 0
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, 02:41 PM Re: Help in table manipulation in asp.net
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 10-03-2007, 08:54 PM Re: Help in table manipulation in asp.net
Skilled Talker

Posts: 65
Trades: 0
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, 08:58 PM Re: Help in table manipulation in asp.net
Skilled Talker

Posts: 65
Trades: 0
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, 09:45 PM Re: Help in table manipulation in asp.net
Skilled Talker

Posts: 65
Trades: 0
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, 07:22 PM Re: Help in table manipulation in asp.net
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 10-09-2007, 08:59 PM Re: Help in table manipulation in asp.net
Skilled Talker

Posts: 65
Trades: 0
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 09:00 PM..
leolim is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Help in table manipulation in asp.net
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.31808 seconds with 12 queries