M
Mike
Can someone look at this and let me know whats wrong and why it is not
working:
when I use this same exact code against the PUBS db it works great, when i
go against my database it does not return data on the selected item selected
in the drop down.
thx
String selectCmd = "SELECT dbo.Task.emailAddress, dbo.Task.tasks,
dbo.Task.datePosted, dbo.Task.comments FROM dbo.Team INNER JOIN dbo.Task ON
dbo.Team.ID = @me";
SqlConnection myConnection = new
SqlConnection("server=server;database=db;Trusted_Connection=yes");
SqlDataAdapter myCommand = new SqlDataAdapter(selectCmd, myConnection);
myCommand.SelectCommand.Parameters.Add(new SqlParameter("@me",
SqlDbType.NVarChar, 2));
myCommand.SelectCommand.Parameters["@me"].Value =
MySelect.SelectedItem.Value;
DataSet ds = new DataSet();
myCommand.Fill(ds, "Task");
MyDataGrid.DataSource= ds.Tables["Task"].DefaultView;
MyDataGrid.DataBind();
working:
when I use this same exact code against the PUBS db it works great, when i
go against my database it does not return data on the selected item selected
in the drop down.
thx
String selectCmd = "SELECT dbo.Task.emailAddress, dbo.Task.tasks,
dbo.Task.datePosted, dbo.Task.comments FROM dbo.Team INNER JOIN dbo.Task ON
dbo.Team.ID = @me";
SqlConnection myConnection = new
SqlConnection("server=server;database=db;Trusted_Connection=yes");
SqlDataAdapter myCommand = new SqlDataAdapter(selectCmd, myConnection);
myCommand.SelectCommand.Parameters.Add(new SqlParameter("@me",
SqlDbType.NVarChar, 2));
myCommand.SelectCommand.Parameters["@me"].Value =
MySelect.SelectedItem.Value;
DataSet ds = new DataSet();
myCommand.Fill(ds, "Task");
MyDataGrid.DataSource= ds.Tables["Task"].DefaultView;
MyDataGrid.DataBind();