[IronPython] DataSet.Tables not callable

kostas daglas daglask at gmail.com
Thu Apr 26 18:19:03 CEST 2007


ds.Tables["AddressBook"].Rows[0][1] works excellent ! thanks again for your
immediate feedback

Kostas

On 4/26/07, 闫 力昕 <yan.lixin at gmail.com> wrote:
>
> try it
> ds.Tables["AddressBook"].Rows[0][1]
> or
> for dr in ds.Tables[AddressBook].Rows:
>  dr[1]
>
>
> 2007/4/26, kostas daglas <daglask at gmail.com>:
> >
> > hi all ! this is my first post and i am new to database programming
> > generally.
> > Anyway i would appreciate your help..
> >
> > i made an Addressbook table with 5 rows (myfriends!) and every row has
> > items (name, surname etc.)i called it AddressBook.mdb
> >
> > I made  a form with a button and a TextBox contorl
> > i want to show when i click the button the first item of a given row in
> > my textbox.
> > i did:
> >             con = OleDb.OleDbConnection()
> >             ds = DataSet()
> >
> >
> >
> >             con.ConnectionString = 'PROVIDER=Microsoft.Jet.OLEDB.4.0;Data
> > Source = C:\AddressBook.mdb'
> >             con.Open()
> >             sql = 'SELECT * FROM tblContacts'
> >
> >             da=OleDb.OleDbDataAdapter(sql, con)
> >             da.Fill(ds, "AddressBook")
> >
> > in c# i could do :
> >             txtFirstName.Text = ds.Tables("AddressBook").Rows(0).Item(1)
> >
> >             how can i do that in IronPython?   ( i tried  it  but :
> > "DataTableCollection object is not callable.". )
> >
> >  Thanks in advance for your help !
> >
> > Kostas
> >
> >
> >
> >
> > _______________________________________________
> > users mailing list
> > users at lists.ironpython.com
> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> >
> >
>
>
> --
> 这两年来慢慢习惯了光说不练.
> _______________________________________________
> users mailing list
> users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20070426/a8a0597a/attachment.html>


More information about the Ironpython-users mailing list