Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 4th, 2005, 08:18 AM
Authorized User
 
Join Date: Apr 2004
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ranakdinesh
Default How To use server.createobject in c#

sub Page_Load ()

dim au
dim str

set au = server.createobject("Persits.AspUser")

str = au.getusername

end sub

Using vb.net, the code works great. I tried the following using C#:

public int Page_Load()
{
string userName;
object au = server.createobject("Persits.AspUser");

userName = au.GetUserName();
}

When I use the C# version of this, I get the following error:

Compiler Error Message: CS0117: 'object' does not contain a definition for 'GetUserName'



dinesh Rana
__________________
dinesh Rana





Similar Threads
Thread Thread Starter Forum Replies Last Post
What is Server,CreateObject("File.clsFile")? SMM Classic ASP Professional 0 May 7th, 2007 08:31 AM
Server.CreateObject Failed patwadd Classic ASP Databases 3 February 7th, 2005 05:46 PM
Server.CreateObject Failed ckwizard77 Classic ASP Components 2 October 23rd, 2004 09:41 AM
Server.CreateObject("Outlook.Application") Dave Sell Classic ASP Professional 1 September 4th, 2004 01:44 PM





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