TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Dong Lam Trien
830
986
147.6k
namespace error when using namespaces that don't match names
Mar 14 2019 1:21 AM
Suppose I create an asp.net website project that loads data into griview from the class library, declaring the library to use loading data for griview
//file: ChitietSP.aspx
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;
// warning
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 * FROM TABKHACHHANG "
; sSQL +=
"ORDER BY MASOPHIEU;"
;
GridView1.DataSource = ClsConnecSQL.FillDatatable(sSQL);
//warning
}
}
//file: clsConnecSQL.cs
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 connectSQL;
namespace
connectSQL
{
public
class
ClsConnecSQL
{
public
static
DataTable FillDatatable(
string
sSQL)
{
//Do somthing...
}
}
}
I have declared the library namespace to be used is still error, asking you to help me
using connectSQL; // warning
GridView1.DataSource = ClsConnecSQL.FillDatatable (sSQL); // error not found connectSQL namespace
Reply
Answers (
4
)
Issue while saving string data from UI into database
submit form & view the data in asp.net with database