Solved

Compare values in datatable using asp.net

Posted on 2006-07-21
2
242 Views
Last Modified: 2008-01-09
I want to test to see if the time in date changes.  If it does i want to write out a blank line.   I can write out a blank line just fine but I need to know how to compare the timein values to see if they change each time.

Thank you


dim query
query="select eh.recordid, firstname + ' ' +  lastname as name, timein, timeout, description from employeehours as eh inner join employeelist as el on eh.employeeid = el.employeeid inner join masterjobcodelist as mjc on eh.jobcode = mjc.jobcode where firstname = 'Justine' and lastname = 'Cleary' and timein  > CONVERT(datetime, '" & strCurrentdate & "', 102) order by timein "
                 
 Dim da As SqlDataAdapter = New SqlDataAdapter(query, objconn)
dim Tbl = new DataTable()
da.Fill(Tbl)
Tbl.columns.add("columnNames")
dim i
dim cou as integer = Tbl.Rows.count()
dim objRow as datarow
'Get the time in date
                                       
while i <> cou
   ' Adding rows
   objRow = Tbl.newrow()
   'objRow("columnNames") = ...
   Tbl.rows.add(objRow)
   i = i + 1
end while

dgAddressBook.DataSource = Tbl        
dgAddressBook.DataBind()
0
Comment
Question by:running32
2 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 17160863
And, what is happening with this code?

Bob
0
 

Author Comment

by:running32
ID: 17171323
I took your advice prior and when with a dataset.

Thanks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to prevent website from publishing with errors 9 60
List<PaisEntity> - show some 1 36
asp.net mvc 2 32
Broken .resx file generating errors 18 14
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question