Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting the SelectCommandTimeout on TableAdapter
Message
 
 
À
30/03/2020 10:04:08
Information générale
Forum:
C#
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01673852
Message ID:
01673893
Vues:
45
Hi,

Did you forget to specify the base class on this line

public partial class ZipXClientChargesTableAdapter ???

What is this class is based on (or which interface it should implement)?

>No one able to spot my probably simple mistake? :(
>
>>Hi,
>>
>>
>>I have done this before on other table adapters successfully but for some reason it is not working on this one and I am not seeing what is causing it.
>>
>>I have some code to load data for a report that is timing out so I want to increase the timeout value, like this:
>>
>>
xxx.DataSets.ZipXClientChargesTableAdapters.ZIPXClientChargesTableAdapter
>>                    zipXClientChargesTableAdapter = new xxx.DataSets.ZipXClientChargesTableAdapters.ZIPXClientChargesTableAdapter();
>>zipXClientChargesTableAdapter.ClearBeforeFill = true;
>>zipXClientChargesTableAdapter.SelectCommandTimeout = 300;
>>
>>This gives the error:
>>
>>xxx.DataSets.ZipXClientChargesTableAdapters.ZIPXClientChargesTableAdapter' does not contain a definition for 'SelectCommandTimeout' and no extension method 'SelectCommandTimeout' accepting a first argument of type 'xxx.DataSets.ZipXClientChargesTableAdapters.ZIPXClientChargesTableAdapter' could be found (are you missing a using directive or an assembly reference?)
>>
>>I have created a file called ZipXClientChargesTableAdapter.cs and placed it in the DataSets folder where the existing ZipXClientCharges.xsd is. This is the code in that file:
>>
>>
using System;
>>using System.Collections.Generic;
>>using System.Linq;
>>using System.Text;
>>
>>
>>namespace xxx.DataSets.ZipXClientChargesTableAdapters
>>{
>>    public partial class ZipXClientChargesTableAdapter
>>    {
>>        public int SelectCommandTimeout
>>        {
>>            get
>>            {
>>                return this.CommandCollection[0].CommandTimeout;
>>            }
>>            set
>>            {
>>                this.CommandCollection[0].CommandTimeout = value;
>>            }
>>        }
>>
>>    }
>>}
>>
>>On the references to this.CommandCollection[0].CommandTimeout, I get an error:
>>
>>'xxx.DataSets.ZipXClientChargesTableAdapters.ZipXClientChargesTableAdapter' does not contain a definition for 'CommandCollection' and no extension method 'CommandCollection' accepting a first argument of type 'xxx.DataSets.ZipXClientChargesTableAdapters.ZipXClientChargesTableAdapter' could be found (are you missing a using directive or an assembly reference?)
>>
>>Which probably is the underlying issue.
>>
>>So, what am I missing?
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform