[求助]关于表与表之间的连接问题
private void joinselect(){
try
{
string cmdtext="select Staff_Name,Role_Name,Role_Description from Staff "
+"inner join StaffRole on Staff.Staff_ID=StaffRole.Staff_ID "
+"inner join Role on StaffRole.Role_ID=Role.RoleID";
SqlConnection conn=new SqlConnection(connection);
conn.Open();
SqlCommand cmd=new SqlCommand(cmdtext,conn);
SqlDataReader sdr=cmd.ExecuteReader();
this.DataGrid1.DataSource=sdr;
this.DataGrid1.DataBind();
Response.Write("成功");
}
catch
{
Response.Write("失败");
}
finally
{
conn.Close();
}
}
请问我这样写的表连接有错吗????系统检查没有错误但是不知道为什么DATAGRID1没有结果显示!