You see the example below why the error not found namespace or class ?
[url]http://www.mediafire.com/file/iiak7w5nhhab3ju/Namespace_asp_net.rar/file[/url]
You see the example below why the error not found namespace or class ?
[url]http://www.mediafire.com/file/iiak7w5nhhab3ju/Namespace_asp_net.rar/file[/url]
Can you please post your code here? The page you linked to seems very spammy.
code here
file ChitietSP.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Diagnostics; // Debug
//using connectSQL;
//using ROOT_Namespace.connectSQL;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadData();
}
}
string sSQL;
private void LoadData()
{
sSQL = "SELECT NGAY, MASOPHIEU, KHACHDUA, TONGTIEN, TONGTHU, TENKH, TEL, ADRESS, GIAM, DOITRA, TTTHANHTOAN, THANHTOAN, MANHANVIEN, NHANVIEN ";
sSQL += "FROM TABKHACHHANGNOCTTMP ";
sSQL += "ORDER BY MASOPHIEU;";
Debug.Print("sSQL: " + sSQL.ToString());
//DataTable dtKhachNoTmp = clsConnecACS.FillDatatable(sSQL);
//ClsConnecSQL abc = new ClsConnecSQL();
//GridView1.DataSource = abc.FillDatatable(sSQL);
GridView1.DataSource = ClsConnecSQL.FillDatatable(sSQL);
}
private void LoadData(string tenNhanVien)
{
sSQL = "SELECT NGAY, MASOPHIEU, KHACHDUA, TONGTIEN, TONGTHU, TENKH, TEL, ADRESS, GIAM, DOITRA, TTTHANHTOAN, THANHTOAN, MANHANVIEN, NHANVIEN ";
sSQL += "FROM TABKHACHHANGNOCTTMP ";
sSQL += "WHERE TABKHACHHANGNOCTTMP.TEN = N'" + tenNhanVien + "' ";
sSQL += "ORDER BY MASOPHIEU;";
Debug.Print("sSQL: " + sSQL.ToString());
GridView1.DataSource = ClsConnecSQL.FillDatatable(sSQL);
}
protected void btnSearch_Click(object sender, System.EventArgs e)
{
if (string.IsNullOrEmpty(txtSearch.Text))
{
lblMessage.ForeColor = System.Drawing.Color.Red;
lblMessage.Text = "Nhập [Tên nhân viên] cần tìm";
}
else
{
lblMessage.Text = "";
LoadData(txtSearch.Text.Trim());
}
}
}
file clsConnecSQL.cs
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Drawing;
using System.Diagnostics;
using System.Data.SqlClient;
//using System.Windows.Forms;
using System.Configuration;
//using connectSQL;
namespace connectSQL //System.Web.UI.Page //
{
public class ClsConnecSQL
{
public static DataTable FillDatatable(string sSQL)
{
string connectionString = "Server=MICROSOFT;uid=sa;pwd=123456;database=NhaDat";
SqlConnection sqlConn = new SqlConnection(connectionString);
sqlConn.Open();
DataTable dataTable = new DataTable();
SqlDataAdapter adapter = new SqlDataAdapter(sSQL, sqlConn);
adapter.Fill(dataTable);
return dataTable;
}
//public static DataTable Plus(int a, int B)/>/>
//{
// return a + b;
//}
}
}
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.