bind database to datagrid

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vahideh
    New Member
    • Oct 2007
    • 1

    bind database to datagrid

    how to bind database to datagrig 2003
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Question moved to .NET Forum.

    Comment

    • jeenajos
      New Member
      • Oct 2007
      • 71

      #3
      Hi,
      First u should declare an instance for SqlDataAdapter, Dataset.
      Eg: Its C#.net code

      Sqldataadapter sda;
      Dataset ds=new DataSet();
      ...
      ...//establish ur connection.

      sda=new sqldataadapter( "Query",connect ion);
      sda.fill(ds);
      Datagrid.dataso urce=ds;
      Datagrid.datame mber=Convert.to String(ds.Table s[0]);
      Datagrid.Databi nd();

      The above is coding section.
      U can also specify the datamember and datasource in property itself.
      I think this may help u. Try out.

      Cheers
      Jeen

      Comment

      • kenobewan
        Recognized Expert Specialist
        • Dec 2006
        • 4871

        #4
        Please read the FAQs on how to post. Thanks.

        Comment

        Working...