日期:2014-05-18 浏览次数:21057 次
SqlConnection oConnect;
SqlCommand oCommand;
string strConnect;
strConnect = ConfigurationManager.ConnectionStrings["receive.Properties.Settings.newConnection"].ConnectionString;
oConnect = new SqlConnection(strConnect);
oCommand = new SqlCommand();
oCommand.Connection = oConnect;
oCommand.CommandText = @"SELECT * FROM RECEIVABLES WHERE ISREAD='0'";
SqlDataAdapter sda = new SqlDataAdapter(oCommand);
DataSet ds = new DataSet();
sda.Fill(ds);
dataGridView3.DataSource = ds.Tables[0].DefaultView;