no.15 error >>  myCommand.Fill(ds,"names");

解决方案 »

  1.   

    1. you need to use a same table name:myCommand.Fill(ds,"names");
    MyDataGrid.DataSource=ds.Tables["Categories"].DefaultView;
    ======>
    myCommand.Fill(ds,"names");
    MyDataGrid.DataSource=ds.Tables["names"].DefaultView;2.do not recommend
    "server=(local);database=TestSql;Trusted_Connection=yes;"use SQL Authentication instead:
    "server=(local);database=TestSql;UID=YourDBLoginID;PWD=YourDBPassword;"3. by the way, you do not have any templates in asp:datagrid, you might want to set
    AutoGenerateColumns="true"