[WebMethod]
public DataSet GetDataSetForum2()
{
DataSet datasource = new DataSet();
string database = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|/topic.mdb;Persist Security Info=True";
string queryStr = "Select * from Comment";
OleDbConnection myConn = new OleDbConnection(database);
OleDbDataAdapter myDataAdapter = new OleDbDataAdapter(queryStr, myConn);
myConn.Open();
myDataAdapter.Fill(datasource, "Comment");
myConn.Close();
return datasource;
}localhost.Topic topic = new localhost.Topic();
string topicId = Request.QueryString["TopicID"].ToString();
string id = "SELECT * FROM Post WHERE ForumID='" + topicId + "'";
datasource = topic.GetDataSetForum2(id);
GridView1.DataSource = datasource;
GridView1.DataBind();
topicid is a int not a string if that makes any difference.
So does a query string need to be within the webservice? I have noticed that there are two querystrings,however if I remove the querystring from the web service it doesnt display anything, as its not querying the table I think? I added the querystring which is located within the website however it stated that the topicid could not be found, so I added that but then it didnt like the response statement.
Thank you for your help