Sunday, February 27, 2011

WPF ComboBox & ListView Load From Database

Combox load & Listview load for our application is one of the most important task in our Development.
For ComboBox:


      private void LoadVendorTYpeComboBox()
        {
            vendorTYpecomboBox.Items.Clear();
            ObjVendorTypeList = ObjBvendorType.GetAllVendirType();
            foreach (EVendorType obj in ObjVendorTypeList)
            {
                vendorTYpecomboBox.Items.Add(obj.VendorType);
            }

          
        }

For ListView:

   private void LoadVendorTypeListView()
        {
            vendorTypelistView.Items.Clear();
            ObjVendorTypeList = ObjBvendorType.GetAllVendirType();
            foreach (EVendorType obj in ObjVendorTypeList)
            {
                vendorTypelistView.Items.Add(obj);
            }
        }

for listview you have to bind the object in list column.

<GridViewColumn DisplayMemberBinding="{Binding Path=VendorType}"  Header="Vendor Type" Width="100"/>

Enjoy...

vfpoledeb.1 provider is not registered on the local machine

Have u Install VFP Ole DB Provider in your System ? If No then Please Install it from following link. http://www.microsoft.com/download...