Click here to Skip to main content
15,913,669 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Problems faced in differend resolution. Pin
Christian Graus18-Aug-08 21:55
protectorChristian Graus18-Aug-08 21:55 
GeneralRe: Problems faced in differend resolution. Pin
UD(IA)18-Aug-08 22:52
UD(IA)18-Aug-08 22:52 
GeneralRe: Problems faced in differend resolution. Pin
Anil Chauhan 250818-Nov-09 23:43
professionalAnil Chauhan 250818-Nov-09 23:43 
GeneralRe: Problems faced in differend resolution. Pin
Rasma Raj19-Aug-08 0:07
Rasma Raj19-Aug-08 0:07 
GeneralRe: Problems faced in differend resolution. Pin
Anil Chauhan 250818-Nov-09 23:46
professionalAnil Chauhan 250818-Nov-09 23:46 
QuestionAjaX TIMER will not start in ascx Pin
Cannery18-Aug-08 13:05
Cannery18-Aug-08 13:05 
QuestionAJAX Accordion control Pin
Cannery18-Aug-08 7:15
Cannery18-Aug-08 7:15 
Questionhow to get all employee id in to single variable? Pin
ram6718-Aug-08 6:49
ram6718-Aug-08 6:49 
I am using .net 2005.i am doing my project in asp.net.my project title is master log attendance.how to get all employee id in to single variable?

We have got employee id from single table by using single variable.but the datas are displayed for final id only.but we want to get more employee id from single variable.

The following code


protected void img_submit_Click(object sender, ImageClickEventArgs e)
{
from_date = txt_fr_date.Text;
to_date = txt_to_date.Text;
emp_name = ddl_emp_name.SelectedValue;
check();
}
void check()
{

System.TimeSpan dt_diff = Convert.ToDateTime(to_date).Subtract(Convert.ToDateTime(from_date));
days = dt_diff.Days;


dt.Columns.Add(new DataColumn("ID", typeof(string)));
dt.Columns.Add(new DataColumn("Name", typeof(string)));

string empid1;
com = new SqlCommand("select distinct(emp_id) from tbl_report", con);
dr = com.ExecuteReader();
while (dr.Read())
{

empid1 = dr.GetString(0);

}
dr.Close();
for (int i = 0; i <= days; i++)

{
sql_date = Convert.ToDateTime(from_date).AddDays(i).ToString("MM/dd/yyyy");
sql_date1 = Convert.ToDateTime(from_date).AddDays(i).ToString("MM/dd/yyyy");


dt.Columns.Add(new DataColumn(sql_date1, typeof(string)));
drow = dt.NewRow();




com = new SqlCommand("select distinct rpt.emp_id as EmployeeID,card.username as EmployeeName,min(case when rpt.datetime1='" + sql_date + "' then rpt.datetime1 end) as '" + sql_date + "' from tbl_card as card,tbl_report as rpt where card.fkdata=rpt.emp_id and rpt.datetime1='" + sql_date + "' and emp_id='" + empid1 + "' group by rpt.emp_id,card.username", con);
dr = com.ExecuteReader();
while (dr.Read())
{
drow[0] = dr.GetString(0);
drow[1] = dr.GetString(1);

drow[i+2] ="x";
dt.Rows.Add(drow);
}
dr.Close();


}



GV_musterrole.DataSource = new DataView(dt);
GV_musterrole.DataBind();

}

in above code,i get all employee id into variable name as empid1.then i put empid1 for employeeid field in where condition of query in for loop.
but displayed only one employee id as follow in grid view,

--ID----Name---10/11/2007--10/12/2007--10/13/2007--10/14/2007--10/15/2007
--370--ramesh---------------------------------------------------------------x

so i want to get all employee id into single variable name as empid1.then put empid1 for employeeid field in where condition of query means,i want to come all employee id details as follow.
--ID----Name---10/11/2007--10/12/2007--10/13/2007--10/14/2007--10/15/2007
--366--dinesh---------------------------x-----------------x----------------x
--367--ram------------------------------x-----------------------------------
--369--guru-----------------------------x----------------------------------x
--370--ramesh--------------------------------------------------------------x
AnswerRe: how to get all employee id in to single variable? Pin
Manas Bhardwaj18-Aug-08 7:21
professionalManas Bhardwaj18-Aug-08 7:21 
AnswerCP IGNORE Pin
leckey18-Aug-08 11:45
leckey18-Aug-08 11:45 
AnswerRe: how to get all employee id in to single variable? Pin
Christian Graus18-Aug-08 11:53
protectorChristian Graus18-Aug-08 11:53 
Questiontrying to use master detail grids !!! Pin
mrkeivan18-Aug-08 6:42
mrkeivan18-Aug-08 6:42 
Questionhow to display the datas in single row? Pin
ram6718-Aug-08 6:00
ram6718-Aug-08 6:00 
QuestionHow can I get Page PreRender to work? Pin
davebarkshire18-Aug-08 5:40
davebarkshire18-Aug-08 5:40 
AnswerRe: How can I get Page PreRender to work? Pin
Abhijit Jana18-Aug-08 6:13
professionalAbhijit Jana18-Aug-08 6:13 
GeneralRe: How can I get Page PreRender to work? Pin
davebarkshire18-Aug-08 6:19
davebarkshire18-Aug-08 6:19 
GeneralRe: How can I get Page PreRender to work? Pin
N a v a n e e t h19-Aug-08 3:10
N a v a n e e t h19-Aug-08 3:10 
Questionproblem in ajax toolkit's control while proper working someplace same code Pin
UD(IA)18-Aug-08 4:53
UD(IA)18-Aug-08 4:53 
AnswerRe: problem in ajax toolkit's control while proper working someplace same code Pin
Tripathi Swati18-Aug-08 19:46
Tripathi Swati18-Aug-08 19:46 
GeneralDowngrade to 1.1 from 2.0 Pin
Brady Kelly18-Aug-08 4:53
Brady Kelly18-Aug-08 4:53 
QuestionOn page focus Pin
omlac18-Aug-08 3:09
omlac18-Aug-08 3:09 
AnswerRe: On page focus Pin
Guffa18-Aug-08 3:52
Guffa18-Aug-08 3:52 
QuestionImage Display in IE7 Pin
Anand Desai18-Aug-08 3:08
Anand Desai18-Aug-08 3:08 
AnswerRe: Image Display in IE7 Pin
NeverHeardOfMe18-Aug-08 7:02
NeverHeardOfMe18-Aug-08 7:02 
Questionviewstate MAC failed error.........urgent Pin
trilokharry18-Aug-08 3:05
trilokharry18-Aug-08 3:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.