|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
MABROUKI
Joined: 10 Mar 2008 Posts: 2
|
Posted: Sun Mar 23, 2008 8:10 pm Post subject: use of dataset object in fnt95.net (ado.net |
|
|
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 |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Wed Mar 26, 2008 9:42 am Post subject: |
|
|
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.
Code: | 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. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|