Click here to Skip to main content
15,886,110 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to add new row to gridview before fill it from datatable? Pin
sanforjackass16-Apr-10 8:00
sanforjackass16-Apr-10 8:00 
GeneralRe: How to add new row to gridview before fill it from datatable? Pin
lamiaa_12316-Apr-10 9:31
lamiaa_12316-Apr-10 9:31 
GeneralRe: How to add new row to gridview before fill it from datatable? Pin
sanforjackass16-Apr-10 9:48
sanforjackass16-Apr-10 9:48 
QuestionFairly simple .NET Remoting scenario but problematic [modified] Pin
Yoyosch16-Apr-10 5:50
Yoyosch16-Apr-10 5:50 
AnswerRe: Fairly simple .NET Remoting scenario but problematic Pin
Michael J. Eber16-Apr-10 20:48
Michael J. Eber16-Apr-10 20:48 
QuestionOverlay sound onto another sound Pin
Ashley Staggs16-Apr-10 4:17
Ashley Staggs16-Apr-10 4:17 
AnswerRe: Overlay sound onto another sound Pin
Thesisus16-Apr-10 8:10
Thesisus16-Apr-10 8:10 
Question[C#] Delegate problem Pin
Ahmed Han16-Apr-10 4:01
Ahmed Han16-Apr-10 4:01 
TcpClient.cs
namespace TCP_Communication
{
    public class TcpClient
    {
        // ...
        public delegate void DataArrivalDelegate(char[] data);
	public DataArrivalDelegate OnDataArrival = null;
        // ...
    }
}


Program.cs
using System;
using System.Collections.Generic;
using System.Text;

namespace TCP_Communication
{
    public class Program
    {
        static void Main(string[] args)
        {
            // ...
			TcpClient Client = new TcpClient();
            // ...
			Client.OnDataArrival = new TcpClient.DataArrivalDelegate(OnDataAvailable);
            // ...
        }
        
        public void DataArrived(char[] newdata)
        {
            // empty for now
        }
    }
}


Error:
'OnDataAvailable': cannot reference a type through an expression; try 'TCP_Communication.TcpClient.OnDataAvailable' instead


I'm new to C#.
I read the article in MSDN about C# delegates, but still I can't find what I'm missing.
Can you please help me fix this problem?

Thanks.
AnswerRe: [C#] Delegate problem Pin
Ian Shlasko16-Apr-10 4:30
Ian Shlasko16-Apr-10 4:30 
QuestionRe: [C#] Delegate problem Pin
Ahmed Han16-Apr-10 4:39
Ahmed Han16-Apr-10 4:39 
AnswerRe: [C#] Delegate problem Pin
Ian Shlasko16-Apr-10 4:53
Ian Shlasko16-Apr-10 4:53 
AnswerRe: [C#] Delegate problem Pin
dybs17-Apr-10 18:15
dybs17-Apr-10 18:15 
GeneralRe: [C#] Delegate problem Pin
Keith Barrow16-Apr-10 4:39
professionalKeith Barrow16-Apr-10 4:39 
GeneralRe: [C#] Delegate problem Pin
Ian Shlasko16-Apr-10 4:50
Ian Shlasko16-Apr-10 4:50 
QuestionHow to spliting a string Pin
mrkeivan16-Apr-10 1:01
mrkeivan16-Apr-10 1:01 
AnswerRe: How to spliting a string [modified] Pin
Neh.C16-Apr-10 1:18
Neh.C16-Apr-10 1:18 
GeneralRe: How to spliting a string Pin
#realJSOP16-Apr-10 1:41
mve#realJSOP16-Apr-10 1:41 
GeneralRe: How to spliting a string Pin
Neh.C16-Apr-10 2:09
Neh.C16-Apr-10 2:09 
AnswerRe: How to spliting a string Pin
Abhinav S16-Apr-10 1:32
Abhinav S16-Apr-10 1:32 
GeneralRe: How to spliting a string Pin
ramzg16-Apr-10 1:37
ramzg16-Apr-10 1:37 
AnswerRe: How to spliting a string Pin
#realJSOP16-Apr-10 1:47
mve#realJSOP16-Apr-10 1:47 
GeneralRe: How to spliting a string Pin
mrkeivan16-Apr-10 1:56
mrkeivan16-Apr-10 1:56 
GeneralRe: How to spliting a string Pin
Ian Shlasko16-Apr-10 4:13
Ian Shlasko16-Apr-10 4:13 
GeneralRe: How to spliting a string Pin
Not Active16-Apr-10 1:57
mentorNot Active16-Apr-10 1:57 
GeneralRe: How to spliting a string Pin
mrkeivan18-Apr-10 4:27
mrkeivan18-Apr-10 4:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.