Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Please Help Out .. Db Problim

Reply
Thread Tools

Please Help Out .. Db Problim

 
 
Stefan Vorster
Guest
Posts: n/a
 
      12-03-2003
Ok i have a table in a database that looks like this

Id , user , Time
1 test 200312341
2 test 324234234
3 userna 232837872

But i just wanne show on the page

test
userna

How can i do that
 
Reply With Quote
 
 
 
 
Ray at
Guest
Posts: n/a
 
      12-03-2003
select distinct [user] from theTable

Ray at home

"Stefan Vorster" <(E-Mail Removed)> wrote in message
news:01a401c3b96c$bcaa26a0$(E-Mail Removed)...
> Ok i have a table in a database that looks like this
>
> Id , user , Time
> 1 test 200312341
> 2 test 324234234
> 3 userna 232837872
>
> But i just wanne show on the page
>
> test
> userna
>
> How can i do that



 
Reply With Quote
 
 
 
 
Bhaskardeep Khaund
Guest
Posts: n/a
 
      12-03-2003
Hi,

Paste this code into a new asp file. Set you Database Connection(objConn) and put your table names.

<html>
<head><title></title></head>
<body>
<table width="80%" align="center">
<%
Dim id, objRs
id = Trim(Request.Form("id"))
sql = "select * from table_name "
Set objRs = Server.CreateObject("ADODB.Recordset")
objRs.Open sql, objConn
while not objrs.EOF
%>
<tr>
<td><%=objRs("id")%></td>
<td><%=objRs("user")%></td>
<td><%=objRs("time")%></td>
</tr>
<%objrs.MoveNext
Wend
%>
</table>
</body>
</html>
<%Set objRs = Nothing %>
 
Reply With Quote
 
Jeff Cochran
Guest
Posts: n/a
 
      12-03-2003
On Tue, 2 Dec 2003 23:11:56 -0800, "Stefan Vorster"
<(E-Mail Removed)> wrote:

>Ok i have a table in a database that looks like this
>
>Id , user , Time
>1 test 200312341
>2 test 324234234
>3 userna 232837872
>
>But i just wanne show on the page
>
>test
>userna
>
>How can i do that


How are you currently showing everything? Either just select the User
column in your SQL query, or when your query returns everything, just
display the user column.

SELECT user FROM table
{Display the whole record set using GetString()}

- or -

SELECT * FROM table
{Display only the User field in a loop}

I prefer the former, you might look at:

http://www.aspfaq.com/show.asp?id=2467

Jeff
 
Reply With Quote
 
 
 
Reply

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ajax File Upload. Please, could someone please help me out? Thanks shapper ASP .Net 0 12-18-2007 02:02 AM
Please please please help this guy with his open source java app casioculture@gmail.com Java 4 05-05-2005 08:24 AM
Computer problems please please please help Nick Computer Support 0 06-04-2004 08:49 PM
HELP! HELP! PLEASE, PLEASE, PLEASE tpg comcntr Computer Support 11 02-15-2004 06:22 PM
please help... ...me learn C++ please please please :) KK C++ 2 10-14-2003 02:08 PM



Advertisments