Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 18th, 2006, 02:51 PM
Authorized User
 
Join Date: Feb 2006
Location: , , .
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problems with database

hi folks:

imports system.data

Private schedule As New DataView()

    Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
  schedule = CType(srcSchedule.Select(DataSourceSelectArguments .Empty), DataView)
        schedule.Sort = "entryDate"
    End Sub
///////////////////////
whenever i run the above code an error message comes up with the following message:

Object reference not set to an instance of an object.
and it highlights the bold message mention in the code.

I wanted this code to highlight the dates in the calendar that have events on them.

Can you please help. thank you very much in advance.

  #2 (permalink)  
Old November 19th, 2006, 06:38 AM
Authorized User
 
Join Date: Feb 2006
Location: , , .
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi folks,

I have seen many people read the message and probably my message was not clear.

My program has a calendar. Every time i enter an event date and a description of what's in the event to my table called Schedule, i want to see a highlight of the date in the calendar which is taken from the eventDate in the table Schedule. So every time a preson click on that date in the calendar he should see what the event is about.
Here is the whole code that i have used to make this happened:

Imports system.data

------------------------------------------
Protected Sub Page_Load(ByVal sender As Object, ByVal e As_ System.EventArgs) Handles Me.Load

        If CalSchedule.SelectedDate = DateTime.MinValue Then
            CalSchedule.SelectedDate = CalSchedule.TodaysDate
        End If

    End Sub
----------------------------------------------------
    Private schedule As New DataView()
----------------------------------------------------

    Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As_ System.EventArgs) Handles Me.PreRender

        schedule = CType(srcSchedule.Select_(DataSourceSelectArgument s.Empty), DataView) schedule.Sort = "entryDate"
    End Sub
----------------------------------------------------
    Protected Sub CalSchedule_DayRender(ByVal sender As Object,_ ByVal e As DayRenderEventArgs) Handles CalSchedule.DayRender_

        If schedule.FindRows(e.Day.Date).Length > 0 Then
            e.Cell.BackColor = System.Drawing.Color.Yellow
        End If
    End Sub


the problem in the above code is in bold. whenever i run the program an error message comes up and says:"Object reference not set to an instance of an object."

Can anyone knows what's the problem?

I hope this is very clear now and thank you very much for your help.

  #3 (permalink)  
Old November 19th, 2006, 06:40 AM
Authorized User
 
Join Date: Feb 2006
Location: , , .
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry the Dashes that i used in some lines is just to show the line of the code is continued in one line.

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Searchbar and Database problems gh64 Access 2 January 12th, 2007 11:04 AM
problems connecting to a database allee_man VB Databases Basics 0 December 22nd, 2004 01:05 PM
Database Entry Problems gmoney060 Classic ASP Databases 4 November 9th, 2004 08:19 AM
Please help - Database problems! highcliffevillage Classic ASP Basics 2 July 7th, 2004 08:43 AM
Problems with database Qing JSP Basics 0 July 7th, 2003 09:54 AM



All times are GMT -4. The time now is 09:39 AM.


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