You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

<span style="color: #800000"><strong>Kısa Tanım:</strong></span>
<span style="color: #1e4e79"> </span>
Form içi buton ile store procedure' dan dönen değerlerin tabloda gösterilmesi örneğidir.
 
<span style="color: #800000"><strong>Açıklama:</strong></span>
<span style="color: #1e4e79"> </span>
<span style="color: #1e4e79">Formdan çıkmadan bir store</span> <span style="color: #1e4e79">procedure' den dönen verileri alıp, tabloda gösterme ihtiyacı için hazırlanmıştır. Bu örneği gerçekleştirmede kullandığımız Store</span> <span style="color: #1e4e79">Procedure' u aşağıda dosya bulabilirsiniz.</span> <span style="color: #1e4e79">Çok basit haliyle LFLOWTESTB ' sindeki MALZEME tablosu select edilmiştir. Bu tablo dolu ise veriler gelecektir.</span>
<span style="color: #800000"><strong>Kod Örneği:</strong></span>
<span style="color: #000080">var</span> result= Context.<span style="color: #191970"><strong>SqlExecuteReader</strong></span>(SqlConnections.LFLOWTESTDB,<span style="color: #0000ff">"exec LFLOWTESTDB..TEST_SP"</span>); <span style="color: #0000ff"><strong>if</strong></span>(result.<span style="color: #191970"><strong>Assigned</strong></span>()){    <span style="color: #0000ff"><strong>foreach</strong></span>(<span style="color: #000080">var</span> row <span style="color: #0000ff"><strong>in</strong></span> result.Rows)    {        Dictionary<<span style="color: #ff0000">string</span>, <span style="color: #ff0000">object</span>> satir = <span style="color: #008b8b"><strong>new</strong></span> Dictionary<<span style="color: #ff0000">string</span>, <span style="color: #ff0000">object</span>>();        <span style="color: #008080"><strong>try</strong></span>{satir.<span style="color: #191970"><strong>Add</strong></span>(malzemeler_Columns.ACIKLAMA,row[<span style="color: #0000ff">"ACIKLAMA"</span>].<span style="color: #191970"><strong>ToString</strong></span>());}<span style="color: #008080"><strong>catch</strong></span>{}        <span style="color: #008080"><strong>try</strong></span>{satir.<span style="color: #191970"><strong>Add</strong></span>(malzemeler_Columns.ADET,row[<span style="color: #0000ff">"ADET"</span>].<span style="color: #191970"><strong>ToDouble</strong></span>());}<span style="color: #008080"><strong>catch</strong></span>{}        <span style="color: #008080"><strong>try</strong></span>{satir.<span style="color: #191970"><strong>Add</strong></span>(malzemeler_Columns.BIRIMFIYAT,row[<span style="color: #0000ff">"BIRIMFIYAT"</span>].<span style="color: #191970"><strong>ToDouble</strong></span>());}<span style="color: #008080"><strong>catch</strong></span>{}        <span style="color: #008080"><strong>try</strong></span>{satir.<span style="color: #191970"><strong>Add</strong></span>(malzemeler_Columns.AD,row[<span style="color: #0000ff">"AD"</span>].<span style="color: #191970"><strong>ToString</strong></span>());}<span style="color: #008080"><strong>catch</strong></span>{}        <span style="color: #008080"><strong>try</strong></span>{satir.<span style="color: #191970"><strong>Add</strong></span>(malzemeler_Columns.DURUM,row[<span style="color: #0000ff">"DURUM"</span>].<span style="color: #191970"><strong>ToInt</strong></span>());}<span style="color: #008080"><strong>catch</strong></span>{}        <span style="color: #008080"><strong>try</strong></span>{satir.<span style="color: #191970"><strong>Add</strong></span>(malzemeler_Columns.KOD,row[<span style="color: #0000ff">"KOD"</span>].<span style="color: #191970"><strong>ToString</strong></span>());}<span style="color: #008080"><strong>catch</strong></span>{}        <span style="color: #008080"><strong>try</strong></span>{satir.<span style="color: #191970"><strong>Add</strong></span>(malzemeler_Columns.TARIH,Convert.<span style="color: #191970"><strong>ToDateTime</strong></span>(row[<span style="color: #0000ff">"TARIH"</span>]));}<span style="color: #008080"><strong>catch</strong></span>{}        <span style="color: #008080"><strong>try</strong></span>{malzemeler.Content.<span style="color: #191970"><strong>AddRow</strong></span>(satir);}<span style="color: #008080"><strong>catch</strong></span>{}    }}
 
<span style="color: #800000"><strong>Akış Dosyası (.xnm):</strong></span>
<span style="color: #800000"> </span>
Aşağıdaki dosyayı indirerek uygulamaya aktarabilirsiniz. İçeri aktarma işleminin nasıl yapıldığına dair bilgi için Aktar bölümünü inceleyebilirsiniz.