Silverfrost Forums

Welcome to our forums

use of dataset object in fnt95.net (ado.net

23 Mar 2008 7:10 #2950

i have an old program for power calculation readind data from a text.file. i want to create an interface in fnt95.net for accessing my data stored in ms access database. i have created a module in fnt95 with purpose to use oledb .

declarations in my modules are :

object('System.Data.Oleb.OledbCommand') macommande object('System.Data.oleb.Oledbdatareader') monlecteur object('system.Data.DataSet') monset

assembly_interface('NAME='System.Data.oleb.Oledbdatareader.Fill') executeLecteur

object('System.string') sqlConnection object('System.string') sqlChaine

integer :: nblignes,i string:: chaine

sqlChaine=NEW@(''System.string','Slect * from Arcs') sqlConnection=NEW@('System.String','Provider=Microsoft.OLEDB.JET.4.4.1;DataSource=c:\mabase\clients.mdb')

macommande=NEW@('System.Data.Oleb.OledbCommand',sqlText,sqlConnection)

monset=NEW@('system.Data.DataSet')

nblignes=executeLecteur(monlecteur,monset)

print *,nblignes

do i=0,to (monset%Tables(0)%Rows%Count-1) chaine= monset%Tables(0)%Rows(i)%Item(0)%toString chaineCAR=CHAR(chaine) print *,chaine end do

i give message like this:

array <number> not declared(tables(0)) . Rows not a member of ('System.DataTableCollection')

although this declaration was accepted in VB NET et and referenced correctly : Tables(0) are referenced as ('System.Data.DaTable') Rows(0) are referenced as member of ('System.Data.DataTable') Item(0) are referenced as member of ('System.Data.DataRow')

can you help me.thanks

26 Mar 2008 8:42 #2953

I have had a brief look at your code but it contains a number of errors. I have removed some of these in the sample below. In particular the classes are case-sensitive and must be spelled correctly.

library 'System.dll'
object('System.Data.OleDb.OleDbCommand') macommande 
object('System.Data.OleDb.OleDbDataReader') monlecteur 
object('System.Data.DataSet') monset 

assembly_external(NAME='System.Data.OleDb.OleDbDataReader.Fill') executeLecteur 

object('System.String') sqlConnection 
object('System.String') sqlChaine 

integer :: nblignes,i 
string:: chaine 

sqlChaine=NEW@('System.String','Slect * from Arcs') 
sqlConnection=NEW@('System.String','Provider=Microsoft.OLEDB.JET.4.4.1;DataSource=c:\\mabase\\clients.mdb') 

macommande=NEW@('System.Data.OleDb.OleDbCommand',sqlText,sqlConnection) 

monset=NEW@('System.Data.DataSet') 

nblignes=executeLecteur(monlecteur,monset) 

print *,nblignes 

do i=0, monset%Tables(0)%Rows%Count-1
chaine= monset%Tables(0)%Rows(i)%Item(0)%toString 
chaineCAR=CHAR(chaine) 
print *,chaine 
end do 
end

A number of errors remain.

Please login to reply.