Click here to Skip to main content
15,920,633 members
Home / Discussions / C#
   

C#

 
Questionweb service Pin
amarnath n.n19-Aug-08 1:32
amarnath n.n19-Aug-08 1:32 
AnswerRe: web service Pin
Christian Graus19-Aug-08 1:40
protectorChristian Graus19-Aug-08 1:40 
QuestionForeach exception Pin
Scalee19-Aug-08 1:30
Scalee19-Aug-08 1:30 
AnswerRe: Foreach exception Pin
Christian Graus19-Aug-08 1:41
protectorChristian Graus19-Aug-08 1:41 
GeneralRe: Foreach exception Pin
Scalee19-Aug-08 1:57
Scalee19-Aug-08 1:57 
GeneralOff topic Pin
chaiguy133719-Aug-08 15:53
chaiguy133719-Aug-08 15:53 
GeneralRe: Foreach exception Pin
Pete O'Hanlon19-Aug-08 1:46
mvePete O'Hanlon19-Aug-08 1:46 
QuestionAnonymous Delegates problem. [modified] Pin
hdv21219-Aug-08 1:03
hdv21219-Aug-08 1:03 
Hi i have a method that fill treeView, i want add node to treeViw by anonymous delegates :

private void GetServerDatabases(TreeView tree, string sqlServerInctance)
        {
            // clear current nodes
            tree.Nodes.Clear();

            // create a server object to interact with sql server inctance
            Microsoft.SqlServer.Management.Smo.Server server = new Microsoft.SqlServer.Management.Smo.Server(sqlServerInctance);

            // iterate through each database which exist in server object
            foreach (Microsoft.SqlServer.Management.Smo.Database db in server.Databases)
            {
                // create a node to hold database (main node or level 0)
                TreeNode dbNode = new TreeNode(db.Name);

                // create a node named 'Tables' to hold tables for each database (level 1)
                TreeNode tablesNode = new TreeNode("Tables");

                // create a node named 'Stored Procedures' to hold storedProcedures for each database (level 1)
                TreeNode spsNode = new TreeNode("Stored Procedures");

                // add Tabales and StoredProcedures node as child to database node
                dbNode.Nodes.Add(tablesNode);
                dbNode.Nodes.Add(spsNode);



                // add db node to treeView                
                tree.Invoke(delegate
                {
                    tree.Nodes.Add(dbNode);
                });
            }            
        }


but in above code (bold words in last lines), the following error message show me :

cannot convert from 'anonymous method' to 'System.Delegate'

how to solve my problem ?
thanks

modified on Tuesday, August 19, 2008 7:37 AM

AnswerRe: Anonymous Delegates problem. Pin
Daniel Grunwald19-Aug-08 1:39
Daniel Grunwald19-Aug-08 1:39 
GeneralRe: Anonymous Delegates problem. Pin
hdv21219-Aug-08 1:48
hdv21219-Aug-08 1:48 
GeneralRe: Anonymous Delegates problem. Pin
N a v a n e e t h19-Aug-08 3:17
N a v a n e e t h19-Aug-08 3:17 
Questionplease Help Pin
Mosd19-Aug-08 0:59
Mosd19-Aug-08 0:59 
AnswerRe: please Help Pin
Abhijit Jana19-Aug-08 1:18
professionalAbhijit Jana19-Aug-08 1:18 
QuestionConvert standard string into rtf format. Pin
CodingLover19-Aug-08 0:37
CodingLover19-Aug-08 0:37 
AnswerRe: Convert standard string into rtf format. Pin
Pete O'Hanlon19-Aug-08 1:02
mvePete O'Hanlon19-Aug-08 1:02 
GeneralRe: Convert standard string into rtf format. Pin
blackjack215019-Aug-08 2:12
blackjack215019-Aug-08 2:12 
AnswerRe: Convert standard string into rtf format. Pin
PIEBALDconsult19-Aug-08 4:29
mvePIEBALDconsult19-Aug-08 4:29 
GeneralRe: Convert standard string into rtf format. Pin
chaiguy133719-Aug-08 15:57
chaiguy133719-Aug-08 15:57 
QuestionRe: Convert standard string into rtf format. Pin
CodingLover19-Aug-08 16:07
CodingLover19-Aug-08 16:07 
QuestionReading PDFs? Pin
Megidolaon18-Aug-08 23:52
Megidolaon18-Aug-08 23:52 
AnswerRe: Reading PDFs? Pin
Christian Graus19-Aug-08 1:19
protectorChristian Graus19-Aug-08 1:19 
AnswerRe: Reading PDFs? Pin
blackjack215019-Aug-08 2:03
blackjack215019-Aug-08 2:03 
GeneralRe: Reading PDFs? Pin
Megidolaon19-Aug-08 3:54
Megidolaon19-Aug-08 3:54 
GeneralRe: Reading PDFs? Pin
blackjack215019-Aug-08 19:07
blackjack215019-Aug-08 19:07 
Questionshowing video Pin
needhi_p18-Aug-08 23:51
needhi_p18-Aug-08 23:51 

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.