The method that isn't there!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Yesterday I was killing some time reading a C# book (Worx 3rd addition C#)
when I stumbled across some code for a data grid the went something like:
“dg1.SetDataBinding(ds, “tblTableNameâ€);â€
Obviously dg1 is a data grid and ds is a data set before I get flamed for
assuming things. My problem is that the minute I could get my grubby little
fingers on my lap top I did a quick check of IntelliSense and there was no
such method when dg1. . I checked the help index and it was listed. The C#
example showed how to use it. So just for kicks (pitiful huh?) I just tried
entering the method as shown in the example. On build I got the expected “No
such method†message. This is not the first time I have seen something in
print that is not in IntelliSense and simply does not work. In a couple of
places you will see overload methods for ToString(). They are not there
either. What is going on here?
Is there really a SetDataBinding method that I just don’t know how to get at?
 
Are you using a System.Web.UI.WebControls.DataGrid or a
System.Windows.Forms.DataGrid? The SetDataBinding method only applies to
the Windows.Forms version.



HTH,

DalePres

MCAD, MCDBA, MCSE
 
OK! That explains that. Everything around that part in the book was about web
forms. I need to keep the diffrece in web and windows in mind more.
 
Back
Top