Compilation errors

Last post 07-22-2005, 12:30 PM by palvin_225. 2 replies.
Sort Posts: Previous Next
  •  07-22-2005, 7:37 AM 8974

    Compilation errors

    To implement a custom CuteChat Provider, you will need to provide a concrete implementation of the CuteSoft.Chat.DataProvider class, CuteSoft.Chat.UserAdapter class and CuteSoft.Chat.ConnectionStringProvider class (optional) , and plug it into the system.

     

     

    Derive a class from the CuteSoft.Chat.DataProvider abstract base class and name it MyDataProvider.

    public class MyDataProvider : CuteSoft.Chat.DataProvider { }

    Can you elaborate this step a bit more for a novice .net user please. Coz so far I cannot figure out how to perform this step.
     
    Thank you,
    Palwinder
  •  07-22-2005, 12:13 PM 8976 in reply to 8974

    Re: Can you explain this?

    When I followed above step, this is what it looked like
     
     *******************************************************
     

    using System;

    using System.Collections;

    using System.ComponentModel;

    using System.Web;

    using System.Web.SessionState;

    namespace WebApplication3

    {

    /// <summary>

    /// Summary description for Global.

    /// </summary>

    public class MyDataProvider : CuteSoft.Chat.DataProvider

    {

    public override string GetUserDisplayName(string uniquename);

    public override string[] ListUserUniqueName();

    public override bool IsAdministrator(string useruniquename);

    public override string[] SearchUserUniqueNameByDisplayName(string name);

     

    }

    public class MyUserAdapter : CuteSoft.Chat.UserAdapter

    {

    public override string GetUserUniqueName(System.Web.HttpContext context);

    }

    public class IbuySpyConnectionStringProvider: CuteSoft.Chat.ConnectionStringProvider

    {

    protected override string GetConnectionString(CuteSoft.Chat.UserIdentity user);

    }

     

    }
     
     
    *******************************************
     
    I got the following errors


    *******************************************
     c:\inetpub\wwwroot\WebApplication3\Global.asax.cs(12): The type or namespace name 'CuteSoft' could not be found (are you missing a using directive or an assembly reference?)
    c:\inetpub\wwwroot\WebApplication3\Global.asax.cs(20): The type or namespace name 'CuteSoft' could not be found (are you missing a using directive or an assembly reference?)
    c:\inetpub\wwwroot\WebApplication3\Global.asax.cs(24): The type or namespace name 'CuteSoft' could not be found (are you missing a using directive or an assembly reference?)
    c:\inetpub\wwwroot\WebApplication3\Global.asax.cs(26): The type or namespace name 'CuteSoft' could not be found (are you missing a using directive or an assembly reference?)

    ***************************************************

    So please suggest
  •  07-22-2005, 12:30 PM 8977 in reply to 8974

    Compilation Error

    Then I moved one step ahead and provided the refrence to cutesoft.chat.dll
     
    the code looked like this:
     
    ***************************************************

    using System;

    using System.Data;

    using System.Web;

    using CuteSoft.Chat;

    using System.Data.SqlClient;

    namespace CuteChatControls

    {

    /// <summary>

    /// Summary description for Class1.

    /// </summary>

    public class MyDataProvider : CuteSoft.Chat.DataProvider

    {

    public override string GetUserDisplayName(string uniquename)

    {

    return useruniquename;

    }

    public override string[] ListUserUniqueName()

    {

    AdminDB admin = new AdminDB();

    SqlDataReader reader = admin.GetUsers();

    ArrayList result = new ArrayList();

    while(reader.Read())

    {

    result.Add(reader.GetString(0));

    }

    return (String[]) result.ToArray(typeof(String));

    }

    public override bool IsAdministrator(string useruniquename)

    {

    String[] roles;

    UsersDB user = new UsersDB();

    roles = user.GetRoles(useruniquename);

    foreach (String role in roles)

    {

    if (role.ToLower()=="admins")

    {

    return true;

    }

    }

    return false;

    }

    public override string[] SearchUserUniqueNameByDisplayName(string name)

    {

    if(userDisplaName==null||userDisplaName=="")return new string[0];

    userDisplaName = userDisplaName.ToLower();

    AdminDB admin = new AdminDB();

    SqlDataReader reader = admin.GetUsers();

    ArrayList names = new ArrayList();

    while(reader.Read())

    {

    try

    {

    string val= reader.GetString(1);

    if(val.ToLower().IndexOf(userDisplaName)!=-1)

    names.Add(val);

    }

    catch{}

    }

    return (string[])names.ToArray(typeof(string));

    }

     

    }

    public class MyUserAdapter : CuteSoft.Chat.UserAdapter

    {

    public override string GetUserUniqueName(System.Web.HttpContext context)

    {

    IIdentity iden=context.User.Identity;

    if(iden==null||!iden.IsAuthenticated)

    returnnull;if(iden.Name==null||iden.Name.Length==0)

    return null;

    return iden.Name;

    }

    }

    public class IbuySpyConnectionStringProvider: CuteSoft.Chat.ConnectionStringProvider

    {

    protected override string GetConnectionString(CuteSoft.Chat.UserIdentity user)

    {

    return System.Configuration.ConfigurationSettings.AppSettings["connectionString"];

    }

    }

     

    }


     
    **************************************
     
    I got these errors
     
     
    C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(16): The name 'useruniquename' does not exist in the class or namespace 'CuteChatControls.MyDataProvider'
    C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(20): The type or namespace name 'AdminDB' could not be found (are you missing a using directive or an assembly reference?)
    C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(21): The type or namespace name 'admin' could not be found (are you missing a using directive or an assembly reference?)
    C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(22): The type or namespace name 'ArrayList' could not be found (are you missing a using directive or an assembly reference?)
    C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(26): The type or namespace name 'result' could not be found (are you missing a using directive or an assembly reference?)
    C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(28): The type or namespace name 'result' could not be found (are you missing a using directive or an assembly reference?)
    C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(34): The type or namespace name 'UsersDB' could not be found (are you missing a using directive or an assembly reference?)
    C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(35): The type or namespace name 'user' could not be found (are you missing a using directive or an assembly reference?)
    C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(49): The name 'userDisplaName' does not exist in the class or namespace 'CuteChatControls.MyDataProvider'
    C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(50): The name 'userDisplaName' does not exist in the class or namespace 'CuteChatControls.MyDataProvider'
    C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(52): The type or namespace name 'AdminDB' could not be found (are you missing a using directive or an assembly reference?)
    C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(53): The type or namespace name 'admin' could not be found (are you missing a using directive or an assembly reference?)
    C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(55): The type or namespace name 'ArrayList' could not be found (are you missing a using directive or an assembly reference?)
    C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(61): The name 'userDisplaName' does not exist in the class or namespace 'CuteChatControls.MyDataProvider'
    C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(62): The type or namespace name 'names' could not be found (are you missing a using directive or an assembly reference?)
    C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(66): The type or namespace name 'names' could not be found (are you missing a using directive or an assembly reference?)
    C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(74): The type or namespace name 'IIdentity' could not be found (are you missing a using directive or an assembly reference?)
    C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(75): The name 'iden' does not exist in the class or namespace 'CuteChatControls.MyUserAdapter'
    C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(76): Only assignment, call, increment, decrement, and new object expressions can be used as a statement
    C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(76): The name 'returnnull' does not exist in the class or namespace 'CuteChatControls.MyUserAdapter'
    C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(76): The type or namespace name 'iden' could not be found (are you missing a using directive or an assembly reference?)
    C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(79): The type or namespace name 'iden' could not be found (are you missing a using directive or an assembly reference?)

    Can you please provide some elaborated details here as you have provided in your examples or tell me which specific example should I follow as I am trying to integrate it into my existing system?
View as RSS news feed in XML