Click here to Skip to main content
15,903,175 members

Comments by Doyle Raymond (Top 13 by date)

Doyle Raymond 26-Mar-12 10:51am View    
thanks.. actually, i'm just a beginner in C#.. thanks 4 ur guide... I really appreciate it..
Doyle Raymond 26-Mar-12 10:44am View    
when i combined my solution...

"Extension method must be defined in a non-generic static class " error displayed..

:(
Doyle Raymond 26-Mar-12 10:41am View    
I did but one error displayed ... :(
i declared like this..

public static tdsReport.PurchaseDataTable ToDataTable<t>(this IList<t> data)
{
PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(typeof(t));
DataTable DT = new DataTable();

foreach (PropertyDescriptor prop in properties)
{
DT.Columns.Add(prop.Name, Nullable.GetUnderlyingType(prop.PropertyType) ?? prop.PropertyType);

foreach (T item in data)
{
DataRow row = DT.NewRow();

foreach (PropertyDescriptor prop2 in properties)
row[prop2.Name] = prop2.GetValue(item) ?? DBNull.Value;
DT.Rows.Add(row);
}
}

return DT as tdsReport.PurchaseDataTable;
}
Doyle Raymond 26-Mar-12 10:12am View    
sorry, i don't know how to explain u...
excuse my bad english !!
I've tdsReport.xsd (DataSet)... and I'm currently developing window application which allows user to filter and display report...
what i need is get the DataTable from DataSet ,as I've mentioned, according to user wants using NHibernate and populate to reportViewer.. but what I know is that reportViewer's Merge Method wants DataSet and what i get from Nhibernate query is IList ... so I want to convert the IList into tdsReport.ReportDataTable... thanks for your help!!
Doyle Raymond 26-Mar-12 10:01am View    
by the way, thanks a lot for your help.. but i gave u wrong info that what i need is DataTable from DataSet.. not from System.Data.DataSet..
sorry, i don't know how to call it...
Convert IList into DataSet DataTable using NHibernate query...
and i am developing in Window Form...
:(

could u help again.. ?? Mario Majcica..