<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.dotnetzone.gr:443/cs/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ADO.NET</title><link>https://www.dotnetzone.gr:443/cs/forums/78/ShowForum.aspx</link><description>Θέματα σχετικά με την προσπέλαση δεδομένων μέσω του ADO.NET και του System.Data namespace</description><dc:language>el</dc:language><generator>CommunityServer 2.1 SP3 (Build: 20423.1)</generator><item><title>Απ: Populate combobox from a datatable</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/53857.aspx</link><pubDate>Sun, 20 Sep 2009 20:20:04 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:53857</guid><dc:creator>nikolaosk</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/53857.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=78&amp;PostID=53857</wfw:commentRss><description>&lt;P&gt;φίλε casp3r,&lt;/P&gt;
&lt;P&gt;σήμανε και την δημοσιευσή σου, σαν "απαντημένη".έτσι έχουμε όλοι καλύτερη άποψη για το τι έχει απαντηθεί και τι είναι Pending...&lt;/P&gt;</description></item><item><title>Απ: Populate combobox from a datatable</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/53856.aspx</link><pubDate>Sun, 20 Sep 2009 19:27:34 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:53856</guid><dc:creator>casp3r</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/53856.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=78&amp;PostID=53856</wfw:commentRss><description>&lt;P&gt;Accepted solution! :)&lt;/P&gt;
&lt;P&gt;thanks..&lt;/P&gt;</description></item><item><title>Απ: Populate combobox from a datatable</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/53855.aspx</link><pubDate>Sun, 20 Sep 2009 19:22:06 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:53855</guid><dc:creator>Panagiotis Kefalidis</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/53855.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=78&amp;PostID=53855</wfw:commentRss><description>Κι έτσι θα έπρεπε. Τo ValueMember απλά δηλώνει απο ποιο πεδίο θα παίρνει τιμή το SelectedValue. Την τιμή θα την διαβάσεις απο το SelectedValue κι όχι απο το ValueMember.</description></item><item><title>Populate combobox from a datatable</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/53852.aspx</link><pubDate>Sun, 20 Sep 2009 19:17:17 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:53852</guid><dc:creator>casp3r</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/53852.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=78&amp;PostID=53852</wfw:commentRss><description>&lt;P&gt;Καταρχήν καλως σας βρήκα.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Είμαι νέος στην κοινωνία του .ΝΕΤ μιας και δούλευα παλαιότερες τεχνολογίες (vb6,vfp 9).&lt;/P&gt;
&lt;P&gt;δεν ξέρω αν είναι το σωστό μέρος για να ποστάρω αυτο το thread, αν δεν είναι συνχωρέστε με. :)&lt;/P&gt;
&lt;P&gt;το πρόβλημα είναι το εξής:&lt;/P&gt;
&lt;P&gt;έχω εναν πίνακα σε SQL SERVER 2005 EXPRESS&lt;/P&gt;
&lt;P&gt;με 2 πεδία (teamid,team)&lt;/P&gt;
&lt;P&gt;και θέλω να γεμίζω ένα combobox &lt;/P&gt;
&lt;P&gt;
&lt;TABLE style="BORDER-BOTTOM:#e5e5e5 1px solid;BORDER-LEFT:#e5e5e5 1px solid;BACKGROUND-COLOR:#f2f2f2;BORDER-TOP:#e5e5e5 1px solid;BORDER-RIGHT:#e5e5e5 1px solid;" border=0 cellSpacing=0 cellPadding=0 width="100%"&gt;

&lt;TR style="LINE-HEIGHT:normal;VERTICAL-ALIGN:top;"&gt;
&lt;TD style="TEXT-ALIGN:right;WIDTH:40px;"&gt;&lt;PRE style="PADDING-BOTTOM:2px;MARGIN:0px;PADDING-LEFT:2px;PADDING-RIGHT:2px;FONT-FAMILY:courier new;COLOR:gray;FONT-SIZE:11px;BORDER-RIGHT:#e7e7e7 1px solid;PADDING-TOP:2px;"&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 &lt;/PRE&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;PRE style="PADDING-BOTTOM:2px;MARGIN:0px;PADDING-LEFT:8px;PADDING-RIGHT:2px;PADDING-TOP:2px;"&gt;&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:black;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt; mycon.Open()

            &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:green;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;'MsgBox("Connection ok")&lt;/SPAN&gt;

            &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;Dim&lt;/SPAN&gt; dt1 &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;New&lt;/SPAN&gt; SqlDataAdapter(&lt;SPAN style="BACKGROUND-COLOR:#e4e4e4;FONT-FAMILY:Courier New;COLOR:#666666;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;"Select team,teamID from teams"&lt;/SPAN&gt;, mycon)
            &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;Dim&lt;/SPAN&gt; ds &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;New&lt;/SPAN&gt; DataSet

            dt1.Fill(ds, &lt;SPAN style="BACKGROUND-COLOR:#e4e4e4;FONT-FAMILY:Courier New;COLOR:#666666;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;"teams"&lt;/SPAN&gt;)

            &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:green;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;' Populate the DataTable to bind to the Combobox.&lt;/SPAN&gt;

            &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;With&lt;/SPAN&gt; hteam

                .DataSource &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:red;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;=&lt;/SPAN&gt; ds.Tables(&lt;SPAN style="BACKGROUND-COLOR:#e4e4e4;FONT-FAMILY:Courier New;COLOR:#666666;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;"teams"&lt;/SPAN&gt;)
                .DisplayMember &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:red;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="BACKGROUND-COLOR:#e4e4e4;FONT-FAMILY:Courier New;COLOR:#666666;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;"team"&lt;/SPAN&gt;
                .ValueMember &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:red;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="BACKGROUND-COLOR:#e4e4e4;FONT-FAMILY:Courier New;COLOR:#666666;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;"teamID"&lt;/SPAN&gt;
                .SelectedValue &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:red;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;=&lt;/SPAN&gt; 0

            &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;With&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;&lt;/P&gt;
&lt;P&gt;και ενώ το displayvalue δουλεύει μια χαρά, το valuemember μου επιστρέφει πάντα "teamid" και όχι το teamid της εκάστοτε εγγραφής.&lt;/P&gt;
&lt;P&gt;τί κάνω λάθος?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ευχαριστώ&lt;/P&gt;</description></item></channel></rss>