M
Mike
I have an asp.net page in C# and this code does not when I point it to my
database, it works fine going against the pubs sql db but not mine
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=servername;database=techForum;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();
what it does is populate a grid depending on what the user selects in the
drop down. Note: this same exact code does work when i point to the pubs, or
nwind database, (just need to change the query.)
database, it works fine going against the pubs sql db but not mine
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=servername;database=techForum;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();
what it does is populate a grid depending on what the user selects in the
drop down. Note: this same exact code does work when i point to the pubs, or
nwind database, (just need to change the query.)