Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 27, 2012 11:41 AM by pierrefrc
Member
8 Points
88 Posts
Apr 27, 2012 10:32 AM|LINK
same project it will works, in new i tried this default.aspx means it not works namespace WebService ws = new WebService();
how will i bring next project this gridview in default.aspx
webservice.cs:
public DataSetGetProducts()
{
string conn = ConfigurationManager.ConnectionStrings["travel"].ToString();
SqlDataAdapter adap;
DataSet ds;
string qry = "select * from tbl_login";
adap =new SqlDataAdapter(qry, conn);
ds =new DataSet();
adap.Fill(ds);
return ds;
}
in default.aspx:
protected void Button1_Click(object sender, EventArgs e)
WebService ws = new WebService();//it is not working in next project default.aspx ? then how will i bring this into next new project defult.aspx ?
GridView1.DataSource = ws.GetProducts();
GridView1.DataBind();
Participant
947 Points
201 Posts
Apr 27, 2012 11:41 AM|LINK
Hi
The problema may be in Add WebReference to your webservice, some projects have and other not.
Here have a sample: http://www.codeproject.com/Articles/22760/Calling-Web-Service-using-ASP-NET http://www.codeproject.com/Articles/42278/Call-a-Web-Service-Without-Adding-a-Web-Reference
I hope this help.
abdhulrazeed...
Member
8 Points
88 Posts
Multiple project error namespace
Apr 27, 2012 10:32 AM|LINK
same project it will works, in new i tried this default.aspx means it not works namespace WebService ws = new WebService();
how will i bring next project this gridview in default.aspx
webservice.cs:
public DataSetGetProducts()
{
string conn = ConfigurationManager.ConnectionStrings["travel"].ToString();
SqlDataAdapter adap;
DataSet ds;
string qry = "select * from tbl_login";
adap =new SqlDataAdapter(qry, conn);
ds =new DataSet();
adap.Fill(ds);
return ds;
}
in default.aspx:
protected void Button1_Click(object sender, EventArgs e)
{
WebService ws = new WebService();//it is not working in next project default.aspx ? then how will i bring this into next new project defult.aspx ?
GridView1.DataSource = ws.GetProducts();
GridView1.DataBind();
}
pierrefrc
Participant
947 Points
201 Posts
Re: Multiple project error namespace
Apr 27, 2012 11:41 AM|LINK
Hi
The problema may be in Add WebReference to your webservice, some projects have and other not.
Here have a sample:
http://www.codeproject.com/Articles/22760/Calling-Web-Service-using-ASP-NET
http://www.codeproject.com/Articles/42278/Call-a-Web-Service-Without-Adding-a-Web-Reference
I hope this help.