.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old May 12th, 2008, 07:37 AM
digitaldxb digitaldxb is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2006
Posts: 155 digitaldxb User rank is Corporal (100 - 500 Reputation Level)digitaldxb User rank is Corporal (100 - 500 Reputation Level)digitaldxb User rank is Corporal (100 - 500 Reputation Level)digitaldxb User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 17 h 25 m 26 sec
Reputation Power: 4
ASP.Net/VB.Net - Getting data in grid for last 7 days.

Hi ,

I am using a function to get data in a grid from sql server

now problem is i want to have data of last 7 days from date field , i tried using the date diff but could not worked any method from which i can get the data for last week , last month , last 6 months, last year any function available :

Code:
Displaydata("Select * from users  where uDate between '" & Format(Date.Now, "Short Date").ToString & "'  and '" & Format(Date.Now, "Short Date").ToString & "' order by uDate")


and using the function

Code:
Sub Displaydata(ByVal comman As String)
        Dim mycommand As SqlCommand
        Dim myuserconn As New Data.SqlClient.SqlConnection(System.Configuration.  ConfigurationManager.ConnectionStrings("test").ToString)
        Try
            myuserconn.Open()
            mycommand = New SqlCommand(comman, myuserconn)
            Dim userdata As SqlDataReader
            userdata = mycommand.ExecuteReader()
            If userdata.HasRows = True Then
                userview.DataSource = userdata
                userview.DataBind()
            End If
        Catch ex As Exception

        End Try
        totrecords.InnerHtml = "Total Users :" & userview.Rows.Count.ToString
        myuserconn.Close()
    End Sub
__________________
SELF REALIZATION IS THE FIRST ENCOUNTER WITH REALITY.- Sahajayoga.org

Reply With Quote
Reply

Viewing: ASP Free ForumsProgramming.NET Development > ASP.Net/VB.Net - Getting data in grid for last 7 days.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway