need some help

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();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,131
Latest member
IsiahLiebe
Top