Click here to Skip to main content
12,448,720 members (52,598 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET
Hi,

Can anyone Know?

The type or namespace name 'DataBaseHelper' could not be found (are you missing a using directive or an assembly reference?)

why this error coming?
protected void BindDataList()
    {
       string sqlCmd = "SELECT clogo FROM tbl_company";
        DataBaseHelper DBHelper = new DataBaseHelper();//error
        DataTable dt = DBHelper.GetTable(sqlCmd);//error
        //adding new column to display image
        DataColumn imageCol = new DataColumn("clogo", typeof(string));
        dt.Columns.Add(imageCol);
        
        if (dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt.Rows[i][imageCol] = string.Format
        ("<img src='Handler.ashx?id={0}' alt='' style='width:100px' />", 
            dt.Rows[i][0].ToString());
            }
        }
Posted 7-Feb-12 2:11am
Updated 7-Feb-12 21:00pm
v3
Comments
Anuja Pawar Indore 8-Feb-12 3:00am
   
Added pre tag
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Check the references in solution explorer, you don't have any reference for this class
  Permalink  
Comments
sathiyak 7-Feb-12 8:23am
   
sorry i did not get....when i'm executing it gives this error...why
Saiyad Kausain 14-Jul-16 7:08am
   
Hello, How to use sqlitehelper in a Smart Device Project in C# or how to connect with sql server database in a Smart Device Project,
Please Help me,
Regards, Saiyad
E-mail: saiyad.talk@gmail.com
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

If You Have The Class Named "DataBaseHelper", Then You Have To Include It In Your Code.

For Eg: Like We Include The Namespace as:
using System.Collections.Generic;
Please Check That.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

Hi,

Double check if you already added the dll file (DataHelper) as your reference.

If this is ok, you can add this in the top.

example:

using DatabaseReference.DataBaseHelper
  Permalink  
Comments
sathiyak 8-Feb-12 2:28am
   
it gives error....
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

Hi,

For DataTable dt = DBHelper.GetTable(sqlCmd);//error

using System.Data;

For DataBaseHelper DBHelper = new DataBaseHelper();//error
You May see this link how this article creates a Customized Class DataBaseHelper

Database Helper v 2.0.0



Regards,
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160811.3 | Last Updated 8 Feb 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100