No overload for method error
-
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(); }
-
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(); }
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.
-
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(); }
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.