SqlConnection thisConnection = new SqlConnection(
@"Server=CVRE1WTZRSTAGNW\SQLSERVER2008;Integrated Security=True;Database=gdbranch;");
thisConnection.Open();
SqlCommand cmd=new SqlCommand();
SqlDataAdapter ada = new SqlDataAdapter();
System.Data.DataTable dataTable = new System.Data.DataTable();
cmd.CommandText = @"select a.branchid,a.pkey,a.pno,a.ptime,a.pmemo,a.useid,b.pbarcode,sum(qty) from " +
@"pdacheck a inner join pdacheckd b on a.pkey=b.pkey";
ada.SelectCommand = cmd;
ada.Fill(dataTable);
this.dgData.DataSource = dataTable;
上面代码会有这个提示,请问是哪里不对,谢谢
cmd.Connection = thisConnection;