Display Data without using SQL Source or database

Posted by Asjad under ASP.NET on 12/17/2010 | Points: 10 | Views : 2140 | Status : [Member] | Replies : 7
Hi Everyone,

I am using an external source HP Quality Center and retrieving all data and storing in different variables and arrays. Now i want to display it.
Is there any way i can use Gridview, or how can i display that data using Tables or what are other ways i can display the data while using all variables from the C#.

Waiting for a positive reply.

Thanks in Advance.....


Kind Regards
Asjad Tariq




Responses

Posted by: Vuyiswamb on: 12/17/2010 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
Good day Asjad

give me the example data that you have or tell me what is the type that hold the final data. i need to give my baby a bath hope then you would have replied and i will give you an answer

Thank you for posting at Dotnetfunda
[Administrator]

Asjad, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Asjad on: 12/17/2010 [Member] Starter | Points: 25

Up
0
Down
Hi

Thanks for your quick reply.

I am getting data in string Array and the integer Array and some of the value will be getting through loop and storing temporarily in a string as well.

There will also be a string L ist as well.
Hope it help, waiting for reply.

Regards
Asjad Tariq

Asjad, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Asjad on: 12/17/2010 [Member] Starter | Points: 25

Up
0
Down

Hi

Thanks for your quick reply.

I am getting data in string Array and the integer Array and some of the value will be getting through loop and storing temporarily in a string as well.

There will also be a string L ist as well.
Hope it help, waiting for reply.

Regards
Asjad Tariq

Asjad, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 12/17/2010 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
Good Day Asjad

I had to take my little baby to bed, she took time to sleep, she wanted to play. :) Children are cute

From what i understand you have a generics list and you want to display it in a gridview. I just prepared an example. if you want to bind the List<string> to a grid view in asp.net you will have to do something like this

My html

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="Gridview1" AutoGenerateColumns="true" runat="server"></asp:GridView>
</div>
</form>
</body>
</html>


and on page load i create my list and bind to the Gridview like this

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
List<string> MyList = new List<string>();
//Prepare my generic List here
for (int i = 0; i < 10; i++)
{
MyList.Add("My Item:" + i.ToString());
}
//Bind the GridView with the List of Items
Gridview1.DataSource = MyList;
Gridview1.DataBind();
}
}


Thank you for posting at Dotnetfunda

Vuyiswa Maseko


Thank you for posting at Dotnetfunda
[Administrator]

Asjad, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Asjad on: 12/17/2010 [Member] Starter | Points: 25

Up
0
Down
Hi

Thanks for your help really apprecciate. One more quick question is that Grid View is something

Heading Heading 2 heading 3
Data1 Data Data
Data1 Data Data
Data1 Data Data


but my view will be like this

Heading Data, Data, Data,
Heading Data, Data, Data,
Heading Data, Data, Data,

And

Heading heading Heading
Heading Data, Data, Data,
Heading Data, Data, Data,
Heading Data, Data, Data,

Thanks Again...
Regards
Asjad

Asjad, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 12/17/2010 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
yes the data will be show like that, you can add more columns on fly if you want

Thank you for posting at Dotnetfunda
[Administrator]

Asjad, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Asjad on: 12/17/2010 [Member] Starter | Points: 25

Up
0
Down
Hi
Thanks for your contineous support, Actually i am a newbie in ASP.NET...

Will you be able to give a coding example where i can add heading dynamically as well.......

If possible i can create a table of 3 rows and 2 columns ......


Thanks again and must say dotnetfunda.com Rocks....

Regards
Asjad

Asjad, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response