Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. No overload for method error

No overload for method error

Scheduled Pinned Locked Moved ASP.NET
help
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rakeshs312
    wrote on last edited by
    #1

    When i am calling Excel() it is showing the error cs1503,it is saying that Excel is not taking the arguments,which argument i have to give in this code

    private void lnkExport_Click(object sender, System.EventArgs e)
    {
    Excel();

    	}
    	private void Excel(DataGrid DGInbox,HttpResponse response)
    	{
    		response.Clear();
    		response.Charset = "";
    		response.ContentType = "application/vnd.ms-excel";
    		StringWriter stringWrite = new StringWriter();
    		HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
    		DGInbox.GridLines = GridLines.None;
    		DGInbox.RenderControl(htmlWrite);
    		for(int i=0;i<DGInbox.Items.Count;i++)
    		{
    			response.Write(DGInbox.Items\[i\].Cells\[0\].Text+"\\n"+DGInbox.Items\[i\].Cells\[1\].Text);
    		}
    
    		response.End();
    
    	}
    
    C G 2 Replies Last reply
    0
    • R rakeshs312

      When i am calling Excel() it is showing the error cs1503,it is saying that Excel is not taking the arguments,which argument i have to give in this code

      private void lnkExport_Click(object sender, System.EventArgs e)
      {
      Excel();

      	}
      	private void Excel(DataGrid DGInbox,HttpResponse response)
      	{
      		response.Clear();
      		response.Charset = "";
      		response.ContentType = "application/vnd.ms-excel";
      		StringWriter stringWrite = new StringWriter();
      		HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
      		DGInbox.GridLines = GridLines.None;
      		DGInbox.RenderControl(htmlWrite);
      		for(int i=0;i<DGInbox.Items.Count;i++)
      		{
      			response.Write(DGInbox.Items\[i\].Cells\[0\].Text+"\\n"+DGInbox.Items\[i\].Cells\[1\].Text);
      		}
      
      		response.End();
      
      	}
      
      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      you should post the actual errror message. However, in this case, it's not hard to see the issue. Buy a basic C# book, and read it. Don't play with things like excel when you have no idea of the basics of C#, it won't help you.

      rakeshs312 wrote:

      Excel();

      rakeshs312 wrote:

      private void Excel(DataGrid DGInbox,HttpResponse response)

      Your error is correct. There is no overload of the Excel method that takes no parameters.

      Christian Graus Driven to the arms of OSX by Vista.

      1 Reply Last reply
      0
      • R rakeshs312

        When i am calling Excel() it is showing the error cs1503,it is saying that Excel is not taking the arguments,which argument i have to give in this code

        private void lnkExport_Click(object sender, System.EventArgs e)
        {
        Excel();

        	}
        	private void Excel(DataGrid DGInbox,HttpResponse response)
        	{
        		response.Clear();
        		response.Charset = "";
        		response.ContentType = "application/vnd.ms-excel";
        		StringWriter stringWrite = new StringWriter();
        		HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
        		DGInbox.GridLines = GridLines.None;
        		DGInbox.RenderControl(htmlWrite);
        		for(int i=0;i<DGInbox.Items.Count;i++)
        		{
        			response.Write(DGInbox.Items\[i\].Cells\[0\].Text+"\\n"+DGInbox.Items\[i\].Cells\[1\].Text);
        		}
        
        		response.End();
        
        	}
        
        G Offline
        G Offline
        Gaurav K Singh
        wrote on last edited by
        #3

        the function written by by needs two parameter, you must pass it in your function call like Excel(datagrid object,response object)

        The miracle is this--the more we share, the more we have.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups