Where the webservice returns a DataTable, is it even possible?
All the samples reference a db/Connection object.
Any pointers are appreciated.
Thanks!
Where the webservice returns a DataTable, is it even possible?
All the samples reference a db/Connection object.
Any pointers are appreciated.
Thanks!
DataTable を返す必要はありません。これは ADO.NET の考え方です。代わりに、pocos (データを表すクラス) のリストを返すことができます。Topten Software の Petapoco ヘルプ ページの例を次に示します。
// Create a PetaPoco database object
var db=new PetaPoco.Database("connectionStringName");
// Show all articles
foreach (var a in db.Query<article>("SELECT * FROM articles"))
{
Console.WriteLine("{0} - {1}", a.article_id, a.title);
}
この例では、「記事」は次のような単純な c# オブジェクトです。
public class article
{
public long article_id { get; set; }
public string title { get; set; }
public DateTime date_created { get; set; }
public bool draft { get; set; }
public string content { get; set; }
}