Click here to Skip to main content
15,880,796 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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?
C#
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
Updated 7-Feb-12 21:00pm
v3
Comments
Anuja Pawar Indore 8-Feb-12 3:00am    
Added pre tag

Check the references in solution explorer, you don't have any reference for this class
 
Share this answer
 
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
If You Have The Class Named "DataBaseHelper", Then You Have To Include It In Your Code.

For Eg: Like We Include The Namespace as:
C#
using System.Collections.Generic;

Please Check That.
 
Share this answer
 
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
 
Share this answer
 
Comments
sathiyak 8-Feb-12 2:28am    
it gives error....
Hi,

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

C#
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,
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900