/// <summary> /// symbol的生成 /// </summary> public void Generate_Symbol() { if (this.myConn == null) { MessageBox.Show("首先请选择一个数据库文件"); return; } this.toolStripStatusLabel2.Text = "正在生成图标... ..."; Meta_SymbolS meta_symbols = new Meta_SymbolS(this.meta_modules); //转换为描述Meta_Symbol信息 meta_symbols.InsertIntoTable(this.myConn); //插入到Meta_SymbolMaster和meta_symboldetail中 this.toolStripStatusLabel2.Text = "图标生成结束."; }
/// <summary> /// 文件的选择,Controlladdr的显示 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button1_Click(object sender, EventArgs e) { OpenFileDialog open_file_dialog = new OpenFileDialog(); if (open_file_dialog.ShowDialog() == DialogResult.OK) { this.file_path = open_file_dialog.FileName; this.toolStripStatusLabel1.Text = "Current File is:" + this.file_path; this.strConn = @"Provider=Microsoft.Jet.OLEDB.4.0;" + @"Data Source=" + this.file_path; this.myConn = new OleDbConnection(this.strConn); this.meta_modules = new Meta_ModuleS(this.myConn); this.meta_symbols = new Meta_SymbolS(this.meta_modules); string sqlStr = "SELECT DISTINCT ControllerAddress FROM Prj_Document"; OleDbDataAdapter da = new OleDbDataAdapter(sqlStr, myConn); DataSet ds = new DataSet(); da.Fill(ds); this.dataGridView_ControlAddr.DataSource = ds.Tables[0].DefaultView; foreach (DataRow row in ds.Tables[0].Rows) { controlladdr_list.Add(row[0].ToString()); } } }