private void BindData()
{
SqlConnection con = new SqlConnection( "server=localhost;database=Northwind;integrated security=true;" );
SqlCommand cmd = new SqlCommand( "SELECT * FROM Customers", con );
try
{
con.Open();
myDataGrid.DataSource = cmd.ExecuteReader();
myDataGrid.DataBind();
con.Close();
}
catch( Exception ) {}
if( con != null && con.State == ConnectionState.Open )
con.Close();
}
标签:VB,NET,到表
版权声明:文章由 百问十五 整理收集,来源于互联网或者用户投稿,如有侵权,请联系我们,我们会立即处理。如转载请保留本文链接:https://www.baiwen15.com/life/260485.html