Web Service - No overload for method 'Forum' takes '1' arguments

[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

0
JohnnyJ
5/16/2008 5:13:23 PM
asp.net.web-forms 93655 articles. 6 followers. Follow

3 Replies
970 Views

Similar Articles

[PageSpeed] 31

You are calling yout web method passing the id, but in your web method does not takes in any parameters. Check your web method GetDataSetForum2 definition.

datasource = topic.GetDataSetForum2(id);


Thanks,
Karan

~ Remember To Mark The Post(s) That Helped You As The ANSWER ~
0
karan
5/16/2008 7:51:42 PM

I noticed that you method GetDataSetForum2() doesn't have any paramters set to it but you are assigning a parameter in your codes which is the id... so remove the id your code like

datasource = topic.GetDataSetForum2(id);

and replace with

datasource = topic.GetDataSetForum2();

But if you need to pass the id in the method then change you method to this

public DataSet GetDataSetForum2(string id)
{

//Your Logic goes here 

 

 


Regards,Vinz

"Code, Beer and Music" that's my way of being a programmer!

How to get your Forum Question Answered | Blog | CodeASP.NET
0
vinz
5/16/2008 8:11:15 PM

 

try
{
   localhost.Topic topic = new localhost.Topic(); 
   string topicId = Request.QueryString["TopicID"].ToString(); 
   public DataSet GetDataSetForum2(string id) 
   {

   "SELECT * FROM Post WHERE ForumID='" + topicId + "'";

   }  

   datasource = topic.GetDataSetForum2(id); 
   GridView1.DataSource = datasource; 
   GridView1.DataBind(); 
}
catch
{}
This is correct, when I tried it I got loads of errors. Also this coding is located within the pageload.



0
JohnnyJ
5/17/2008 8:03:44 AM
Reply:

Similar Artilces:

No overload for method 'Forum' takes '1' arguments
I am getting this error - No overload for method 'Forum' takes '1' argumentsCan anyone help?I am using a web service created by myself Topic Page<asp:HyperLinkField DataNavigateUrlFormatString="~/topic.aspx?TopicID={0}" NavigateUrl="~/topic.aspx" Text="Comments" DataNavigateUrlFields="TopicID" />Comments Page localhost.Topic topic = new localhost.Topic(); string topicId = Request.QueryString["TopicID"].ToString(); datasource = topic.Forum("SELECT * FROM Comment WHERE TopicID =" +topicId); GridView1....

what does 'No overload for method 'Insert' takes '1' arguments' mean?
code that caused this error: line AddInBookSqlDataSource2.Insert(item);protected void inbookButton_Click(object sender, EventArgs e){ try{ AddInBookSqlDataSource1.Insert(); }catch (Exception ex){ uploadSPoneLabel.Text = "Saved Failed: SP One" + ex.Message; }foreach (ListItem item in authorsListBox5.Items){ try{ AddInBookSqlDataSource2.Insert(item); saveStatusLabel.Text = "Save Successful: SP Two"; }catch (Exception ex1){saveStatusLabel.Text = "Save Failed: SP Two" + ex1.Message; } } } any help appreciated Thanks in advance At a surface leve...

No overload for method 'FormatImagePath' takes '1' arguments
Hi, I am getting the error message above on the code below.  I did not write the code.  I am new to ASP.NET and I had to download Visual Studio 2005 to compile my C# files.  The website was written in a previous version and the error message appeared when I tried compiling after the conversion to ASP.NET 2.0. by Visual Studio.  I don't understand the error message and I am not entirely clear on what the code is doing.  Would anyone be able to help?    <table> <tr><td></td></tr> <tr><...

No overload for method 'FieldValue' takes '1' arguments
Very confused, the recordset returns a record, all is working, but it's just giving me an error?????? anybody knows how to solve this, Compiler Error Message: CS1501: No overload for method 'FieldValue' takes '1' arguments Source Error: Line 19: { Line 20: Line 21: Response.Redirect(ds_redirect.FieldValue("url")); Line 22: } Line 23: ---------------------------- When removing the fieldvalue I receive another error Compiler Error Message: CS0118: 'ASP.frame_redirect_url_aspx.ds_redirect' denotes a 'field' where a 'method' was expected...

''''''''''''''''''''
Name: haznen Email: haznenatyahoodotcom Product: Gran Paradiso Alpha 8 Summary: '''''''''''''''''''' Comments: '''''''''''''''''''''''''''''''''''' Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061204 UGES/1.7.2.0 GranParadiso/3.0a1 From URL: http://www.mozilla.org/projects/granparadiso/ Note to readers: Hendrix gives...

CS1501: No overload for method 'ToShortDateString' takes '1' arguments
Hello,  I'm quite new in ASP.NET. I'm developing a website for my company where people can request a reservation. Therefor I made a form where there is a Calendar where they can pick a date for their reservation-request. I'd like to make all the dates 'till "today+1" unselectable. I didn't found a way to do this so I use a CompareValidator to check whether the day they selected is "greater than today". Unfortunately I get this errormessage "CS1501: No overload for method 'ToShortDateString' takes '1' arguments" while it is a solution I found on the web. Can someone please help me. Than...

'''''
Name: mario Email: ramar17atfastwebnetdotit Product: Gran Paradiso Alpha 2 Summary: ''''' Comments: K: Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a2) Gecko/20070206 GranParadiso/3.0a2 ...

Error Message: No overload for method 'SqlParameter' takes '1' arguments
Dear All,   I have a problem while trying to update the content of my page to the database by the means of a stored procedure string OcompConnection = ConfigurationManager.ConnectionStrings["GenUserCode"].ConnectionString;  System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(OcompConnection); System.Data.SqlClient.SqlCommand ocmd = new System.Data.SqlClient.SqlCommand("Dealer_Insert", conn);ocmd.CommandType = CommandType.StoredProcedure; ocmd.Parameters.Add(new SqlParameter("@UserCode"), SqlDbType.NVarChar); oc...

Compiler Error Message: CS1501: No overload for method 'ToString' takes '1' arguments
Compiler Error Message: CS1501: No overload for method 'ToString' takes '1' argumentsSource Error: Line 248: //{ Line 249: Line 250: int RollNo = Convert.ToInt32(str.ToString(str.Append(GridView1.Rows[i].Cells[1].Text))); Line 251: Line 252: DeleteStudent(RollNo); Source File: h:\Office Works\Projects\Sample Applications\GridViewVitCode.aspx.cs    Line: 250 Please solve this problem  This is the complete code  protected void Button2_Click(object sender, EventArgs e) {for (int i = 0; i <...

No overload for method 'uf_save_dw_as_excel' takes '2' arguments
I'm trying to save my DW using the Dw2xls Powerbuilder Library for converting DW to Excel, when is Generating PowerBuilder .NET assemblies failed. Isn't complain for this version 11.5? Anyone knows how to correct this problem? Thanks to all. are you trying the demo version? It comes with PBD file which cannot be included in a demo WEBFORM applicatiom, just ion a native one. However, the presentation XLS you'll get under PB native would be the same in a webform application. When you buy the product, you'll receive the PBL source of DW2XLS which the could be ...

No overload for method 'ReportParameter' takes '2' arguments
I am trying to render a report that runs on our remote SQL Reporting Server to the ReportViewer control in my C# asp.net page.  The reports will need to have various parameters past to it.  However, every example I see on how to do this looks something like this (this is from MSDN):ReportParameter p = new ReportParameter("ShowDescriptions", "test");this.ReportViewer1.ServerReport.SetParameters(new ReportParameter[] { p }); However, this will not build for me, I get the error:No overload for method 'ReportParameter' takes '2' argumentsIn fact, when I mouse over ReportParameter,...

No overload for method 'Add' takes '3' arguments
For some reason, I don't know if maybe I'm just not using the right method for the adding of parameters, but I get this error during the build:No overload for method 'Add' takes '3' arguments            Should I be using Add here?  I did see using dbCommandWrapper.AddInParameter here but I do'nt think that's a valid method in Enterprise Library 2.0: http://aspalliance.com/688Part of my code:....some code beforeDatabase db = DatabaseFactory.CreateDatabase();             DbCommand dbCommandWrapper = db.GetStoredProcCommand("...

CS1501: No overload for method 'buildQuery' takes '0' arguments
I am getting the following message when i try to execute my code; "CS1501: No overload for method 'buildQuery' takes '0' arguments", where am i going wrong, my code is below;public static DataSet SQLExecute(string strSQL) { string strTableName;string strData; DataSet dsetResponse = new DataSet(); try {using (SqlConnection conn = new SqlConnection(DHOC.clsDHOC.GetConnString())) {SqlCommand cmd = new SqlCommand("SELECT '" + strData + "' FROM '" + strTableName + "' where '" + strData + "' = 'Column...

CS1501: No overload for method 'Insert' takes '5' arguments
 Hi,Can some one please help me im getting this error and i cant figuer out way its happening this is the full error i get... Compiler Error Message: CS1501: No overload for method 'Insert' takes '5' arguments Source Error: Line 27: DataSetTableAdapters.MemberInfoTableAdapter da = new DataSetTableAdapters.MemberInfoTableAdapter();Line 28: MembershipUser user = Membership.GetUser(CreateUserWizard1.UserName);Line 29: ...

Web resources about - Web Service - No overload for method 'Forum' takes '1' arguments - asp.net.web-forms

Resources last updated: 11/21/2015 5:35:54 AM