Click here to Skip to main content
15,894,180 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionHave an external web page open in a ContentArea Pin
Matthew Hansel15-Aug-08 8:15
Matthew Hansel15-Aug-08 8:15 
AnswerRe: Have an external web page open in a ContentArea Pin
N a v a n e e t h15-Aug-08 8:40
N a v a n e e t h15-Aug-08 8:40 
QuestionHow to get the values displayed / present in a control present in the grid view Pin
AprNgp15-Aug-08 7:59
AprNgp15-Aug-08 7:59 
AnswerRe: How to get the values displayed / present in a control present in the grid view Pin
N a v a n e e t h15-Aug-08 8:43
N a v a n e e t h15-Aug-08 8:43 
GeneralRe: How to get the values displayed / present in a control present in the grid view Pin
AprNgp15-Aug-08 19:29
AprNgp15-Aug-08 19:29 
Questionthe button in gridview row Pin
strawberrysh15-Aug-08 7:44
strawberrysh15-Aug-08 7:44 
AnswerRe: the button in gridview row Pin
AlexeiXX315-Aug-08 7:51
AlexeiXX315-Aug-08 7:51 
Questioninstead of displaying date,how to display string in gridview? Pin
sathyan_829415-Aug-08 5:11
sathyan_829415-Aug-08 5:11 
hai all,
i want to display 'P' instead of date in single line in grid view.
Here P means Present.
i have 2 table named as employee details and attendance.
emp_id and emp_name are the 2 field names for employee details table.
emp_id and date1 are the 2 field names for attendance table.

values in attendance table are
emp_id--------date1
---11---------10-08-2008
---11---------11-08-2008
---11---------12-08-2008

here datatype is datetime for date1 field.
in attendance table, the date values (10-08-2008,11-08-2008,12-08-2008) are present date for emp_id 11.

in output side,i select employeename as ajay from employeenamedropdownlist,then i select fromdate as 09-08-2008,then i select todate as 13-08-2008,then i finally click submit button.

when i click submit button,the following output coming in grid view using my program

EmployeeID--EmployeeName--09-08-2008--10-08-2008--11-08-2008--12-08-2008--13-08-2008
---11--------------------Ajay------------------------------10-08-2008
---11--------------------Ajay------------------------------------------------11-08-2008
---11--------------------Ajay-------------------------------------------------------------------12-08-2008

but this output is wrong.
here 2 mistake.
1st mistake:
instead of 'P',displaying date in 3 lines.
P means Present.
2nd mistake:
Displaying 3 lines for same employeeid and employeename.

so i want to display 'P' instead of date in single line in grid view as follow

EmployeeID-----EmployeeName-----09-08-2008-----10-08-2008-----11-08-2008-----12-08-2008-----13-08-2008
---11-------------------Ajay-------------------------------------------P-------------------P--------------------P
how to do this?

here my program using C# in asp.net

protected void SubmitButton_Click(object sender, ImageClickEventArgs e)
{
from_date = fromdatetextbox.Text;
to_date = todatetextbox.Text;
emp_name = employeenamedropdownlist.SelectedValue;
check();
}
void check()
{
System.TimeSpan dt_diff = Convert.ToDateTime(to_date).Subtract(Convert.ToDateTime(from_date));
days = dt_diff.Days;
for (int i = 0; i <= days; i++)
{
sql_date = Convert.ToDateTime(from_date).AddDays(i).ToString("MM/dd/yyyy");
da = new SqlDataAdapter("select distinct a.emp_id as EmployeeID,a.emp_name as EmployeeName,min(case when b.date1='" + sql_date + "' then b.date1 end) as '" + sql_date + "' from employeedetails as a,attendance as b where a.emp_id=b.emp_id and b.date1='" + sql_date + "' group by a.emp_id,a.emp_name", con);
da.Fill(dt);
}
GV_musterrole.DataSource = new DataView(dt);
GV_musterrole.DataBind();
}


any other program(C# or VB.net) or any other logic or any other way is there.
Questionsql question Pin
eyeseetee15-Aug-08 4:01
eyeseetee15-Aug-08 4:01 
AnswerRe: sql question Pin
Manas Bhardwaj15-Aug-08 4:06
professionalManas Bhardwaj15-Aug-08 4:06 
AnswerRe: sql question Pin
eyeseetee15-Aug-08 4:38
eyeseetee15-Aug-08 4:38 
GeneralRe: sql question Pin
AprNgp15-Aug-08 7:50
AprNgp15-Aug-08 7:50 
AnswerRe: sql question Pin
metallica_rock1017-Aug-08 23:35
metallica_rock1017-Aug-08 23:35 
Questiongrid view in asp.net using c# Pin
UD(IA)15-Aug-08 3:33
UD(IA)15-Aug-08 3:33 
AnswerRe: grid view in asp.net using c# Pin
Rutvik Dave15-Aug-08 4:06
professionalRutvik Dave15-Aug-08 4:06 
Questionpick and show starting text in asp.net from database Pin
dream_liner_7e715-Aug-08 3:32
dream_liner_7e715-Aug-08 3:32 
AnswerRe: pick and show starting text in asp.net from database Pin
eyeseetee15-Aug-08 3:35
eyeseetee15-Aug-08 3:35 
AnswerRe: pick and show starting text in asp.net from database Pin
Rutvik Dave15-Aug-08 4:18
professionalRutvik Dave15-Aug-08 4:18 
QuestionSystem.InvalidOperationException : Please help Pin
AprNgp15-Aug-08 2:36
AprNgp15-Aug-08 2:36 
AnswerRe: System.InvalidOperationException : Please help Pin
Rutvik Dave15-Aug-08 4:27
professionalRutvik Dave15-Aug-08 4:27 
GeneralRe: System.InvalidOperationException : Please help Pin
AprNgp15-Aug-08 5:35
AprNgp15-Aug-08 5:35 
GeneralRe: System.InvalidOperationException : Please help Pin
AprNgp15-Aug-08 7:44
AprNgp15-Aug-08 7:44 
Question'The underlying connection was closed: The connection was closed unexpectedly.' Error Pin
pubududilena15-Aug-08 1:15
pubududilena15-Aug-08 1:15 
AnswerRe: 'The underlying connection was closed: The connection was closed unexpectedly.' Error Pin
AhsanS15-Aug-08 1:18
AhsanS15-Aug-08 1:18 
GeneralRe: 'The underlying connection was closed: The connection was closed unexpectedly.' Error Pin
pubududilena15-Aug-08 1:31
pubududilena15-Aug-08 1:31 

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.