How to extract Data From WebMethod [Resolved]

Posted by Manorama under ASP.NET AJAX on 4/25/2013 | Points: 10 | Views : 1756 | Status : [Member] | Replies : 0
hi to all......

here my Requirement is binding Data table 1.9 Dynamically for this i am calling Data thru ajax source with webMethod.and I have 3 rows for columns;
Now I want different data for 3 rows like row1 containing ex1,row2 contains ex2,row3 means ex3;currently i am getting ex1 for all 3 rows;first of all i am unable to get 3 different values from ajax;and i don't know how to bind this to rows of Data table 1.9 using Html;
[System.Web.Services.WebMethod]
public static string[] GetNewColumnData(string columnname)
{
string[] colData = new string[3];
try
{
DataClasses1DataContext db = new DataClasses1DataContext();
Table<RowData_tbl> row = db.GetTable<RowData_tbl>();
Table<TreeviewChildNodes_tbl> child = db.GetTable<TreeviewChildNodes_tbl>();
//Query for getting Id of ColumnName
var colId = from cid in child
where cid.ChildName.Equals(columnname)
select new { id = cid.ChildId };
Int64 col=0;
foreach(var item in colId)
col= Int64.Parse(item.id.ToString());
//Query for Getting Row Information According to Column Name
var rowData = from c in row
where c.ChildId.Equals(col)
select new { rowName=c.RowTitle }; .................this rowData holds 3 different values from DB

string rowDetails = string.Empty;
foreach (var r in rowData)
rowDetails = r.rowName.ToString();
foreach (var r in rowData)
{
for (int i = 0; i < rowData.Count(); i++)
{
colData = r.rowName.ToString(); .....//here I am getting Same Information How to extract the information of rowdata

}

}


}
catch (Exception ex)
{

}
return colData;
}
How to extract the information of rowdata Please guide me

ManoRama


Responses

(No response found.)

Login to post response