public void setData(int transid, SQLConnector scon) { sCon = scon; dS = new DataSet(); TransID = transid; if (transid >= 0) { lb_id.Text = "Trans-ID: " + transid; } //load DataSets sDA_offers = sCon.getOffers_List(dS, null); sDA_sellers = sCon.getSellers_List_FullName(dS, null); sDA_transaction = sCon.getTransaction(dS, "transaction", null, TransID); //set Data to Form-Elements lBox_offer.DataSource = dS.Tables["offers"]; lBox_offer.DisplayMember = "OfferName"; lBox_offer.ValueMember = "OfferID"; lBox_seller.DataSource = dS.Tables["sellers"]; lBox_seller.DisplayMember = "SellerName"; lBox_seller.ValueMember = "SellerID"; if (dS.Tables["transaction"].Rows.Count > 0) { lb_id.Text = "Trans-ID: " + dS.Tables["transaction"].Rows[0]["ID"]; lBox_offer.SelectedValue = dS.Tables["transaction"].Rows[0]["offerID"]; lBox_seller.SelectedValue = dS.Tables["transaction"].Rows[0]["sellerID"]; nTB_contingent.Text = ((int)dS.Tables["transaction"].Rows[0]["seller_contingent"]).ToString(); } }