hi
I keep getting this message whenever I delete something from a database. What I am doing is implementing the delete fucntion for a post in a forum. I have two applciation a Webservice and a Website
Here is my code for the method in the service
Code:
[WebMethod]
public DataSet GetPosts(string queryStr)
{
DataSet ds = new DataSet();
setupConnection();
OleDbDataAdapter myDataAdapter = new OleDbDataAdapter(queryStr, connection);
myDataAdapter.Fill(ds, "Posts");
connection.Close();
return ds;
}
and here is the code in the website
Code:
protected void Repeater_ItemCommand(object sender, RepeaterCommandEventArgs e)
{
DataSet ds;
int postId = Convert.ToInt32(e.CommandArgument);
switch (e.CommandName)
{
case "Del":
Response.Write("the id of the post clicked = " + postId);
string delPost = "DELETE * FROM Posts WHERE PostID =" + postId;
myws.DeletePost(delPost);
object temp = Session["trdID"];
int h = Convert.ToInt32(temp) + 1;
object temp2 = Session["secID"];
int i = Convert.ToInt32(temp2) + 1;
string queryStr = "SELECT Posts.*, Accounts.* FROM Posts INNER JOIN Accounts ON Posts.AccountID = Accounts.ID WHERE ThreadID = "+h+" AND SectionID = "+i+" ORDER BY DateCreated";
ds = myws.GetPosts(queryStr);
BindRepeater();
break;
case "Edit":
break;
}
}
However I get a SOAP exception on this line
Code:
ds = myws.GetPosts(queryStr);
...with...
____
"System.Data.OleDb.OleDbException: No value given for one
or more required parameters."
____
This is due to the dataadapter not being able to be filled for some reason. I dont know if its because im deleting from an access database or not...
Can anyone help?