RT

解决方案 »

  1.   

    this.m_strsql="usp_GetProdQCRptDate 'IKD-060001-08'";
    this.m_sqlconn="workstation id=SC296;packet size=4096;user id=sa;Pwd=sa;data source='192.168.1.237';persist security info=False;initial catalog=NetSystem"; this.m_ds=new DataSet(); System.Data.SqlClient.SqlDataAdapter sda=new System.Data.SqlClient.SqlDataAdapter(this.m_strsql,this.m_sqlconn);
    sda.Fill(this.m_ds);
      

  2.   

    楼上的是fill进DataSet
    也可以用SqlCommand 和 SqlDataReader配合使用。
      

  3.   

    回一楼你的FILL是错误的。如果FILL的是DataSet,Fill时要指名表名的。 
    sda.Fill(this.m_ds,“tablename”);我是想知道DataAdapter的底层是如何执行相当与Command.ExecuteReader()的。
    因为这里没有一条执行语句就直接FILL了。