3
Answers

How to call multiple value store in List?

hello,My question is I have store 3 or more username and password in app.config file then this appsettings data i will store in list Then i will create one forloop to execute data one by one
list<strings>values=in this values i will store appsettings and with help of forloop i want to execute as for(int i=0;i<values.count;i++)
{
here i have some class which i want to connect as follows
connectionoptions conn=new connoptions();
conn.username=values(i);here i want to add 3 or more username at one to know the username while complie
conn.password=values(i) here i want to add 3 or more password at one .....and so on..
then here we can see add values(i) towards username and password it doing well i m or not tell me buddys how i add tellme guys.. i hope we understood i m trying..
Thanq!
 

Answers (3)

0
Photo of Hermes Condez
NA 32 0 13y

try this one, though I didn't test this on printing the exported XLS

protected void ExportToXls_Click(object sender, EventArgs e) //On click Event of a control (button/link button/hyperlink)
 {

        this.DataGridView1.AllowPaging = false;

        ExportGridViewToExcel(Response, this.DataGridView1, "Exported.xls");
 }

 public void ExportGridViewToExcel(HttpResponse response, GridView gvControl, string fileName)
        {
            string attachment = "";
            System.IO.StringWriter sw = new System.IO.StringWriter();
            HtmlTextWriter htw = new HtmlTextWriter(sw);
            response.AddHeader("content-disposition", "attachment; filename=" + fileName);
            response.ClearContent();
            response.AddHeader("content-disposition", attachment);
            gvControl.AllowPaging = false;
            gvControl.DataBind();
            gvControl.RenderControl(htw);
            response.Write(sw.ToString());
            response.Flush();
            response.End();

            gvControl.AllowPaging = true;
        }

 public override void VerifyRenderingInServerForm(Control control) // I just got this in forum just
           // add this. I don't why but it will work if this is added
        {
        }