2013-01-19 93 views
-1

在應用程序中存在代碼,它填充從數據庫中的表中獲取數據的二進制dat文件中的列表框。 正在使用的代碼是使用dat文件填充列表框

public string getclientid(string sectorid) 
    { 
     try 
     { 
      DataSet dsobj = new DataSet(); 
      bllobj = new ConverterClass(); 
      string retclientval = "0"; 

      dsobj = bllobj.BinaryDeSerialize(strDataPath + "\\" + "BinaryClientlocation.dat"); 
      DataRow[] dr = dsobj.Tables[0].Select("client_location_id in(" + locationid + ")"); 
      if (dr.Length > 0) 
      { 
       foreach (DataRow drow in dr) 
       { 
        retclientval = retclientval + "," + drow["client_id"].ToString(); 
       } 
      } 
      return retclientval; 
     } 

如何找到哪個是從中生成的二進制文件,這樣就可以添加新的客戶端表。 使用的DBMS是Sql Server 2005.

回答

0

此代碼無法幫助您。
從db讀取數據並將其寫入自己的二進制格式後,它與數據庫表沒有任何關係。

你應該去尋找編寫BinaryClientlocation.dat文件的代碼。

1

如果您有權訪問數據庫.dat文件來自那裏,那麼您可能不需要二進制文件來填充列表框。看看數據集,或Linq to SQL