Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
| Search | Today's Posts | Mark Forums Read
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old November 24th, 2006, 06:35 AM
Authorized User
 
Join Date: Jul 2006
Location: Mumbai, Maharastra, India.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to kau_shuk
Default Trying to retrive data for particulare date

I am trying to retrieve data for a particulare date from sql server 2000 using vb.net 2002 windows form it gives me error my code is:

        con.Close()
        con.Open()
        Dim se As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter("Select FollowUpDate,Details from note where FollowUpDate = " & Today, con)
        Dim d As New Data.DataSet()
        se.Fill(d)
        remigrid.DataSource = d.Tables(0)
        con.Close()

can any body help me to solve this

Thanks in Advance

  #2 (permalink)  
Old November 24th, 2006, 08:53 PM
Registered User
 
Join Date: Aug 2006
Location: , , China.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi:
the right code should as following:

con.Open()
        Dim se As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter("Select FollowUpDate,Details from note where FollowUpDate = '" & format(Today,"d") & "'", con)
        Dim d As New Data.DataSet()
        se.Fill(d)
        remigrid.DataSource = d.Tables(0)
        con.Close()

first of all,you have to promise the oledb.oledbconnection object was closed,otherwise you should receive as error message.
any other problem you can email to me,my email is:yuetqu@163.com

good luck!



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to retrive image from database gaurav gupta ASP.NET 2.0 Professional 1 July 21st, 2008 10:44 AM
Inputed data will be retrive as admin want?? deadlock Beginning VB 6 0 May 7th, 2008 12:47 PM
how to retrive the column properties harshagowda Access 1 December 3rd, 2004 12:13 PM
How do i retrive login name drachx General .NET 6 October 7th, 2004 07:35 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.