D
DarkWing
Hello Every one i had a question
i am setting up an DataGrid with use of MS SQL server
in my sqlserver i have 2 tables
1-UserList(which containes Employee's Name)(has 13
elements,eg 13 employees)
2-ScheduleSetting(Which Containes Employees hours of
avilbilites to work)(has 13 elements)
Now my dataGrid is trying to recived infromation from
these 2 tables..i have no problem in that...where the
problem arises is when executing the bindGridData() method
****
private void bindGridData(){
sCmd = new SqlCommand("SELECT hpw, u_username
FROM UserList, scheduleSetting", conn);
try{
conn.Open();
hpwGrid.DataSource=sCmd.ExecuteReader();
hpwGrid.DataBind();
conn.Close();
}catch(Exception e){
this.errorMessage=e.ToString();
}
}
*****
every element in UserList tabel matches 13 times with
every element of ScheduleSetting..so i end up having
something like this
eg
Alex 1hr
Alex 2hr
Alex 3hr
.. .
.. .
Alex 13hr
Jen 1hr
Jen 2hr
.. .
.. .
Jen 13hr
now both of my tables have U_id colums in them(which are
excatly the same) i just dont know how to set up my
method to match each u_id so it would show something like
this instead
Alex 1hr
Jen
i am setting up an DataGrid with use of MS SQL server
in my sqlserver i have 2 tables
1-UserList(which containes Employee's Name)(has 13
elements,eg 13 employees)
2-ScheduleSetting(Which Containes Employees hours of
avilbilites to work)(has 13 elements)
Now my dataGrid is trying to recived infromation from
these 2 tables..i have no problem in that...where the
problem arises is when executing the bindGridData() method
****
private void bindGridData(){
sCmd = new SqlCommand("SELECT hpw, u_username
FROM UserList, scheduleSetting", conn);
try{
conn.Open();
hpwGrid.DataSource=sCmd.ExecuteReader();
hpwGrid.DataBind();
conn.Close();
}catch(Exception e){
this.errorMessage=e.ToString();
}
}
*****
every element in UserList tabel matches 13 times with
every element of ScheduleSetting..so i end up having
something like this
eg
Alex 1hr
Alex 2hr
Alex 3hr
.. .
.. .
Alex 13hr
Jen 1hr
Jen 2hr
.. .
.. .
Jen 13hr
now both of my tables have U_id colums in them(which are
excatly the same) i just dont know how to set up my
method to match each u_id so it would show something like
this instead
Alex 1hr
Jen