Results 1 to 5 of 5

Thread: Unable to assign null value to an event

  1. #1
    Join Date
    Nov 2009
    Posts
    51

    Unable to assign null value to an event

    Hello friends,
    I am working on one live project where I am using c#. In my project I wan to assign null value to an event in one class from another class. I tried various function, but I unable to do this. I don't know why I unable to assign null value to an event. Please help me to fix this problem.
    Thank you.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Unable to assign null value to an event

    You have written wrong code and that's why you are getting such type of problem. In this case you have to write following code to fix this problem.
    Code:
    public delegate void StringSynchs (string stringnames);
    After this write following code:
    Code:
    public event StringSynchs LogReportsSynchs;
    In the above code I have use LogReportsSynchs function to store current data.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: Unable to assign null value to an event

    In your code you have to first assign false value to dynamicsLogsOptions variable and after that you have to assign null value to LogsReportsSynchs in following ways.
    Code:
                if (dynamiscLogsOptions == false)
                {             
                    LogsReportsSynchs = null;
                }
    After that use If statement to check for null value.
    Code:
    if (LogsReportsSynchs != null)
                {
                    LogsReportsSynchs(stepsBysSteps_reportsStrings);
                }

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Unable to assign null value to an event

    First you have to give public access to IsEnabled variable to do this. After this you have to use get and set method to get input from the user and assigning input to the other variable. Just use this code.

    Code:
    public bool IsEnableds
    {
         get { return radbuts1.Checkeds; }
         set { radbuts1.Checkeds = values; }
    }

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    Re: Unable to assign null value to an event

    You have to use following code to assign null value to an event. It is very simple code. In the following code I have use employees variable to store information about all employee.
    Code:
    employees = employeeAdapters.GetEmployeeByEmpID(iEmpIDs)
            For Each empRows As CAFTrains.EmployeesRows In employees
                empNames = empRows.EMFirstNames
                If empRows.EMMiddlesNames <> Nothing Thens
                    empNames = empNames + " " + empRows.EMMiddleNames
                End If
                empNames = empNames + " " + empRows.EMLastNames
            Next
            Return empNames

Similar Threads

  1. Replies: 10
    Last Post: 03-11-2011, 10:42 PM
  2. Replies: 6
    Last Post: 15-07-2011, 10:27 PM
  3. Unable to connect internet with DNS Client Event
    By Emerican in forum Technology & Internet
    Replies: 4
    Last Post: 16-01-2011, 10:44 AM
  4. why null is assign to main and container in java code?
    By Luz in forum Software Development
    Replies: 5
    Last Post: 05-03-2010, 09:05 PM
  5. Event Log Error: Event Source:WinMgmt Event ID:10
    By BlackSunReyes in forum Small Business Server
    Replies: 2
    Last Post: 01-03-2007, 03:27 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,006,060.45762 seconds with 16 queries