Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Cannot apply indexing with [] to an expression of type 'ADODB.Fields'

[es] :: .NET :: .NET Desktop razvoj :: Cannot apply indexing with [] to an expression of type 'ADODB.Fields'

[ Pregleda: 2296 | Odgovora: 3 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

theilusion

Član broj: 331616
Poruke: 44
31.223.144.*



+1 Profil

icon Cannot apply indexing with [] to an expression of type 'ADODB.Fields'18.01.2016. u 16:30 - pre 99 meseci
Pozdrav svima.
Da li neko zna šta znači greška u naslovi i kako da je prevaziđem.
Napominjem da sam u sklopu projekta dodao u referencu adodb.

U kodu sam pod komentarom "//ERROR" naveo gde kompajler vraca greske.

Pretpostavljam da moram negdje navesti tip propertija "Fields". Hvala unapred.
Code:

private void TestEmailSettings ()
        {
            CDO.Message message;
            message=new CDO.MessageClass();
            message.To=Settings.UserEmail;
            message.Subject=String.Format("{0} - Test message for {1}",Settings.ProductName,Settings.Name);
            message.HTMLBody="User: "+Settings.Name+"<BR>"+"This is a test Message";
            message.From=txtFrom.Text;

            CDO.Configuration config;
            config=new CDO.ConfigurationClass();
            config.Fields["http://schemas.microsoft.com/cdo/configuration/sendusing"].Value=2;   //ERROR
            config.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserver"].Value=txtServer.Text;   //ERROR
            config.Fields["http://schemas.microsoft.com/cdo/configuration/sendusername"].Value=txtUser.Text; //ERROR
            config.Fields["http://schemas.microsoft.com/cdo/configuration/sendpassword"].Value=txtPassword.Text;  //ERROR
            config.Fields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"].Value=1;  //ERROR
            config.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserverport"].Value=Convert.ToInt32(txtPort.Text);   //ERROR
            config.Fields["http://schemas.microsoft.com/cdo/configuration/smtpusessl"].Value=chkUseSSL.Checked;  //ERROR
            
            config.Fields.Update();
            message.Configuration=config;

            message.Send();
        }



 
Odgovor na temu

mmix
Miljan Mitrović
Profesorkin muz
Passau, Deutschland

SuperModerator
Član broj: 17944
Poruke: 6041



+4631 Profil

icon Re: Cannot apply indexing with [] to an expression of type 'ADODB.Fields'18.01.2016. u 19:51 - pre 99 meseci
To znaci da klasa ADODB.Fields nema indekser.

Verovanto ima neki GetItem ili Item koji radi taj posao.
Sloba je za 12 godina promenio antropološki kod srpskog naroda. On je od jednog naroda koji je bio veseo, pomalo površan, od jednog naroda koji je bio znatiželjan, koji je voleo da vidi, da putuje, da upozna,
od naroda koji je bio kosmopolitski napravio narod koji je namršten, mrzovoljan, sumnjicav, zaplašen, narod koji se stalno nešto žali, kome je stalno neko kriv… - Z.Đinđić
 
Odgovor na temu

theilusion

Član broj: 331616
Poruke: 44
31.223.144.*



+1 Profil

icon Re: Cannot apply indexing with [] to an expression of type 'ADODB.Fields'18.01.2016. u 22:41 - pre 99 meseci
Zanimljivo.
Inace ovo bildujem u .net 4.0 a postojeci kod pisan je za .net 1.1 čini mi se.
Možeš li mi samo još napisati primjer (npr. da ADODB.Fields radi sa GetItem) kako da se riješim indeksera.

Recimo za prvi sa reda:
Code:

config.Fields["http://schemas.microsoft.com/cdo/configuration/sendusing"].Value=2;


Unaprijed hvala.

 
Odgovor na temu

theilusion

Član broj: 331616
Poruke: 44
*.teol.net.



+1 Profil

icon Re: Cannot apply indexing with [] to an expression of type 'ADODB.Fields'19.01.2016. u 07:16 - pre 99 meseci
Ipak nije potrebno pisati novi kod.
Dodao sam novu referencu u projekat i ADODB.Fields je poznao indeksere.

Hvala u svakom slucaju.
 
Odgovor na temu

[es] :: .NET :: .NET Desktop razvoj :: Cannot apply indexing with [] to an expression of type 'ADODB.Fields'

[ Pregleda: 2296 | Odgovora: 3 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.