10 pts.
Q:
grid view connection to a data in a table ?!
Hello ,
I'm julien , beginner in visual studio 2008 using c# language

I Have this task that I seem to be stuck in !

I've created a database using sql server express 2005 of 4 tables :"BOOKS , AUTHORS , CATEGORIES and PUBLISHERS ".

I've connected this database to my gridview in visual studio , it shows me all the books like this : " BOOK publisher , TITLE, CATEGORY "

the problem is that my task is to show what every author has in terms of books .
and I cant figure out how to do that !!!!

can u tell me if any of this code that I'm using is helpfull or not ???



public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string ConnectionString = "Data Source=-------;Initial Catalog=julien;Integrated Security=True";
string selectSQL = "SELECT Console.WriteLine("AUTHOR ID" );

}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
if (!this.IsPostBack)
{


string ConnectionString ="Data Source=----------;Initial Catalog=julien;Integrated Security=True";
string selectSQL = "SELECT [category], [title], FROM [books JOIN AUTHORS] ORDER BY [title], [category], " GROUP BY author name;



System.Data.SqlClient.SqlConnection con = new System.Data.SqlClient.SqlConnection("julienCS");
System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand(selectSQL, con);
System.Data.SqlClient.SqlDataAdapter adapter = new System.Data.SqlClient.SqlDataAdapter(cmd);
DataSet ds = new DataSet();

adapter.Fill(ds, "BOOKS ");

GridView1.DataSource = ds;
GridView1.DataBind();
}
}
}
ASKED: Jun 24 2009  7:20 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
10 pts.
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • Bookmark and Share
Last Answered: Jun 24 2009  7:20 AM GMT by Julien51   10 pts.
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Carlosdl   34805 pts.  |   Jun 24 2009  1:47PM GMT

You will probably need to change your SQL statement.

Could you please explain this:

my task is to show what every author has in terms of books

Could you post some example data ?