下了,用不了,没有.net framework1.1!我用的时1.0

解决方案 »

  1.   

    连不上数据库.
    选择那两个单选框时出现bug."未将对象引用设置到对象的实例"
      

  2.   

    这是你的一个方法吧private bool WriteToXML(string filePath, bool haveData)
    { StringBuilder builder1;
    int num1;
    SqlDataAdapter adapter1;
    DataSet set1;
    bool flag1;
    if ((filePath == null) || (filePath.Length == 0))
    {
     throw new ArgumentNullException("保存文件名称");
     
    }
    if (this.isFromTable)
    {
     this.cm.CommandType = 1;
    if (this.lstField.SelectedItems.Count == 0)
    {
     this.cm.CommandText = string.Concat("select * from ", this.cboTable.SelectedItem.ToString());
     
    }
    else
    { builder1 = new StringBuilder("select ");
    for (num1 = 0; (num1 < this.lstField.SelectedItems.Count); num1 = (num1 + 1))
    {
     if (num1 == 0)
    {
     builder1.Append(this.lstField.SelectedItems[num1].ToString());
     
    }
    else
    { builder1.Append(string.Concat(",", this.lstField.SelectedItems[num1].ToString()));
     
    }
     
    }
    builder1.Append(string.Concat(" from ", this.cboTable.SelectedItem.ToString()));
    this.cm.CommandText = builder1.ToString();
     
    }
     
    }
    else
    { this.cm.CommandType = 4;
    this.cm.CommandText = this.cboProcedure.SelectedItem.ToString();
     
    }
    adapter1 = new SqlDataAdapter(this.cm);
    set1 = new DataSet();
    adapter1.Fill(set1);
    if (haveData)
    {
     try
    {
     set1.WriteXml(filePath, 0);
    flag1 = true;
    goto L_0175;
     
    }
    catch (object obj1)
    {
     flag1 = false;
    goto L_0175;
     
    }
     
    }
    try
    {
     set1.WriteXmlSchema(filePath);
    flag1 = true;
     
    }
    catch (object obj2)
    {
     flag1 = false;
     
    }
     
    L_0175:
     return flag1; 
    }