//数据库连接字串
string myConnectionString = "data source=RAINFISH;initial catalog=car;persist security info=False;user id=sa;workstation id=RAINFISH;packet size=4096";
SqlConnection myConnection = new SqlConnection(myConnectionString); string mySelectQuery = "select * from TbAutoDispatchNote where AutoDispatchNote_AutoDispatchBill_Id = '"+strBillId+"'";
SqlDataAdapter myDataAdapter = new SqlDataAdapter(mySelectQuery, myConnection);
DataSet MyDataSet = new DataSet();
myDataAdapter.Fill(MyDataSet,"note");
myConnection.Close();你可以参考以上,将SQL语句更改就行了的。

解决方案 »

  1.   

    具体情况我觉得是sql2000中的某一属性没有设好而不是进入编程后的问题啊,因为我在c#中进行data conections时,就是把sql2000中的表拖向form生成sqlconection1,和sqldataAdapter1时弹出对话框提示updata和delete错误啊错误detail就是Could not determine which columns uniquely identify the rows for "student".和
    Could not determine which columns uniquely identify the rows for "student啊?
      

  2.   

    你在表中加一个具有identify属性的字段ID
    以ID为主键对表进行操作。
      

  3.   

    这个问题我碰到过,其实他的出错信息就很明白的说了:
    不能准确定位唯一的行更新或者删除,
    我上次是看了数据库里面有垃圾(错误)数据,删除掉就好了,用query analyzer删防止这样的问题应该做好数据表的设计,加上主键,一般就不会出现