Click here to Skip to main content
16,018,057 members
Home / Discussions / C#
   

C#

 
GeneralRe: i have a problem in treeview Additional information: Index was outside the bounds of the array. Pin
BillWoodruff31-Dec-20 23:05
professionalBillWoodruff31-Dec-20 23:05 
GeneralRe: i have a problem in treeview Additional information: Index was outside the bounds of the array. Pin
Richard MacCutchan31-Dec-20 23:13
mveRichard MacCutchan31-Dec-20 23:13 
GeneralRe: i have a problem in treeview Additional information: Index was outside the bounds of the array. Pin
BillWoodruff1-Jan-21 0:00
professionalBillWoodruff1-Jan-21 0:00 
GeneralRe: i have a problem in treeview Additional information: Index was outside the bounds of the array. Pin
Richard MacCutchan1-Jan-21 0:24
mveRichard MacCutchan1-Jan-21 0:24 
AnswerRe: i have a problem in treeview Additional information: Index was outside the bounds of the array. Pin
Gerry Schmitz31-Dec-20 9:15
mveGerry Schmitz31-Dec-20 9:15 
GeneralRe: i have a problem in treeview Additional information: Index was outside the bounds of the array. Pin
BillWoodruff31-Dec-20 22:58
professionalBillWoodruff31-Dec-20 22:58 
GeneralRe: i have a problem in treeview Additional information: Index was outside the bounds of the array. Pin
Gerry Schmitz2-Jan-21 9:28
mveGerry Schmitz2-Jan-21 9:28 
QuestionWCF Service doesn't return data Pin
Member 1483009827-Dec-20 6:00
Member 1483009827-Dec-20 6:00 
Hello, i want to create simple mobile add using Xamarin who use WCF Service, but i have problem with return data from database.

Firstly i connect database with WCF and create code:

IServiceWhitewagon:
[ServiceContract]
    public interface IServiceWhitewagon
    {

        [OperationContract]
        List<CompanyForView> GetCompany();
    }

ServiceWhitewagon
public class ServiceWhitewagon : IServiceWhitewagon
   {
       public ServiceWhitewagon()
       {

       }

  public List<CompanyForView> GetCompany()
       {
           WhitewagonEntities db = new WhitewagonEntities();
           return
               (from company in db.Company
                select new CompanyForView
                {
                    idCompany = company.idCompany,
                    name = company.name,
                    phone = company.phone,
                    adress = company.adress
                }
                ).ToList();
       }
   }


CompanyForView
[DataContract]
    public class CompanyForView
    {
        [DataMember]
        public int idCompany { get; set; }

        [DataMember]
        public string name { get; set; }

        [DataMember]
        public string adress { get; set; }

        [DataMember]
        public string phone { get; set; }
    }


In next step i connect WCF with my app called AppMobileWhitewagon
Screen

While connect WCF I usinghttp://localhost:54308/ and i saw all created metod in WCF. Whats more i test WCF in WCT Test Client and i see data from datatable:
Screen

In MobileApp i have problem with show data from datatable. When in App I click on the button who should show card with data from datatable app freeze on 20 seconds and show empty card.

My code in class who should get data
public class CompanyDataStore : ItemDataStore<Company>
    {
        public CompanyDataStore()
        {
            items = zamowieniaServices.GetCompany(null).GetCompanyResult.Select(k => new Company
            {
                idCompany = k.idCompany,
                name = k.name,
                phone = k.phone,
                adress = k.adress
            }).ToList();
        }
    }


ItemDataStore
public abstract class ItemDataStore<T> : IDataStore<T>
    {
        public List<T> items;

        public IServiceWhitewagon zamowieniaServices { get; set; }

        public ItemDataStore()
        {
            zamowieniaServices = DependencyService.Get<ServiceReferenceWhitewagon.IServiceWhitewagon>();
        }
    }


I create 3 breakpoint in app:
Screen

App stop in first breakpoint, and when i Continue run code does not cause next breakpoint

P.S 1

I suppose that with my View is everythink ok, since when i change code in CompanyDataStore to this, app show data from this list

items = new List<Company>()
           {
              new Company{idCompany=1,name="Klient 1"},
              new Company{idCompany=2,name="Klient 2"},

           };

QuestionRegEx Not Properly Matching Pin
#realJSOP26-Dec-20 3:07
professional#realJSOP26-Dec-20 3:07 
AnswerRe: RegEx Not Properly Matching Pin
OriginalGriff26-Dec-20 4:09
mveOriginalGriff26-Dec-20 4:09 
GeneralRe: RegEx Not Properly Matching Pin
#realJSOP26-Dec-20 4:26
professional#realJSOP26-Dec-20 4:26 
GeneralRe: RegEx Not Properly Matching Pin
OriginalGriff26-Dec-20 5:08
mveOriginalGriff26-Dec-20 5:08 
GeneralRe: RegEx Not Properly Matching Pin
#realJSOP26-Dec-20 5:26
professional#realJSOP26-Dec-20 5:26 
GeneralRe: RegEx Not Properly Matching Pin
Richard Deeming4-Jan-21 22:28
mveRichard Deeming4-Jan-21 22:28 
AnswerRe: RegEx Not Properly Matching Pin
Gerry Schmitz26-Dec-20 14:54
mveGerry Schmitz26-Dec-20 14:54 
AnswerRe: RegEx Not Properly Matching Pin
jschell29-Dec-20 6:46
jschell29-Dec-20 6:46 
GeneralRe: RegEx Not Properly Matching Pin
#realJSOP30-Dec-20 3:16
professional#realJSOP30-Dec-20 3:16 
AnswerRe: RegEx Not Properly Matching Pin
Richard Deeming4-Jan-21 22:37
mveRichard Deeming4-Jan-21 22:37 
Questionsource code Pin
Member 1503068825-Dec-20 23:41
Member 1503068825-Dec-20 23:41 
AnswerRe: source code Pin
Sandeep Mewara25-Dec-20 23:51
mveSandeep Mewara25-Dec-20 23:51 
QuestionData format for non-computerist editing Pin
trønderen22-Dec-20 10:23
trønderen22-Dec-20 10:23 
AnswerRe: Data format for non-computerist editing Pin
OriginalGriff22-Dec-20 11:05
mveOriginalGriff22-Dec-20 11:05 
GeneralRe: Data format for non-computerist editing Pin
trønderen22-Dec-20 14:26
trønderen22-Dec-20 14:26 
GeneralRe: Data format for non-computerist editing Pin
BillWoodruff22-Dec-20 15:17
professionalBillWoodruff22-Dec-20 15:17 
GeneralRe: Data format for non-computerist editing Pin
trønderen23-Dec-20 8:24
trønderen23-Dec-20 8:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.