Results 1 to 4 of 4

Thread: asp.net parameter on datasource error

  1. #1
    Senior Member
    Join Date
    Sep 2007
    Posts
    409
    Thanks
    7
    Thanked
    32 times in 12 posts
    • icanhazburger's system
      • Motherboard:
      • Foxconn 946GZ7MA/946PL7MA Series
      • CPU:
      • DualCore Intel Core 2 Duo E6400
      • Memory:
      • 2 gig DDR2-667
      • Storage:
      • 320gig Baracuda II
      • Graphics card(s):
      • 7900 GS vc3600 cooler
      • PSU:
      • 600w
      • Case:
      • Something with a 25cm fan
      • Monitor(s):
      • 1 x 22"w 1 x 19"
      • Internet:
      • Pipex Max :(

    asp.net parameter on datasource error

    I'm getting this error when trying to set a parameter on a access data source at run time, I want to do it dynamically, so ignore the code below trying to put a fixed date in, thats just me trying to get it to work for now, and that value works if its set as default for the parameter so I know that should not be causing a problem.

    Error message -

    Compiler Error Message: BC30545: Property access must assign to the property or use its value.

    Where the error happens -

    Code:
    Protected Sub AccessDataSource1_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs)
        e.Command.Parameters["D4_Date"].Value="31/12/2008"
        End Sub
    Please save my sanity, I've wasted far to long trying to figure this one out.
    In the internets, no one can hear you sarcasm.

  2. #2
    Flower Child stytagm's Avatar
    Join Date
    Aug 2004
    Location
    London
    Posts
    754
    Thanks
    47
    Thanked
    23 times in 18 posts

    Re: asp.net parameter on datasource error

    Quote Originally Posted by icanhazburger View Post
    Compiler Error Message: BC30545: Property access must assign to the property or use its value.
    I think it means you can only access the ".Value" property, not assign to it. Try the following instead:
    Code:
    Protected Sub AccessDataSource1_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs)
        e.Command.Parameters["D4_Date"] = "31/12/2008"
        End Sub
    Only add the .Value bit if you want to read it. Let us know if that works.
    They told me I was gullible ... and I believed them.

  3. #3
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts

    Re: asp.net parameter on datasource error

    Since when did VB have those crazy square brackets everyone else has been using!
    To err is human. To really foul things up ... you need a computer.

  4. #4
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts

    Re: asp.net parameter on datasource error

    You might also want to look into ISO standard-format dates too. For your sanity.
    To err is human. To really foul things up ... you need a computer.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. graphics card error
    By amit12345 in forum PC Hardware and Components
    Replies: 0
    Last Post: 09-04-2007, 03:43 PM
  2. Did my OC cause this?
    By myth in forum PC Hardware and Components
    Replies: 19
    Last Post: 05-04-2005, 12:36 PM
  3. 8o!! taste hot WineX powaaah!
    By directhex in forum Software
    Replies: 33
    Last Post: 31-05-2004, 08:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •