首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

简略的 增删改查

2012-08-24 
简单的 增删改查try{String connectionString Integrated SecuritySSPIPersist Security InfoFalse

简单的 增删改查

 try    {        String connectionString =            "Integrated Security=SSPI;Persist Security Info=False;" +            "Initial Catalog=Northwind;Data Source=localhost";        dataAdapter = new SqlDataAdapter(selectCommand, connectionString);        SqlCommandBuilder commandBuilder = new SqlCommandBuilder(dataAdapter);        DataTable table = new DataTable();        table.Locale = System.Globalization.CultureInfo.InvariantCulture;        dataAdapter.Fill(table);        bindingSource1.DataSource = table;        dataGridView1.AutoResizeColumns(             DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader);    }    catch (SqlException)    {        MessageBox.Show("To run this example, replace the value of the " +            "connectionString variable with a connection string that is " +            "valid for your system.");    }

热点排行