Click here to Skip to main content
Rate this: bad
good
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
Edited 7-Feb-12 21:00pm
v3
Comments
Anuja Pawar Indore at 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 at 7-Feb-12 8:23am
   
sorry i did not get....when i'm executing it gives this error...why
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 at 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)



Advertise | Privacy | Mobile
Web03 | 2.8.140827.1 | Last Updated 8 Feb 2012
Copyright © CodeProject, 1999-2014
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