Hi, I need to display images from a particular path, in which the images are not stored in the data base. Can anybody help with some sort of code will be very much helpfull for me. Thanks in advance
Elizabeth Rani
Posts
-
Display images in Gridview -
Sending mail using SMTPHi, Can you help me some sort of code please. Thanks in advance
-
Sending mail using SMTPHi All, Can any body help me with some code to send mail using smtp i have a code but mail is not send to a particular mail id. i have written a code as SmtpClient smtpClient = new SmtpClient(); MailMessage message = new MailMessage(); try { MailAddress fromAddress = new MailAddress("xyz@gmail.com", "ABC"); message.From = fromAddress;//here you can set address message.To.Add("abc@gmail.com.com");//here you can add multiple to message.Subject = "Feedback";//subject of email message.Body = @"Plain or HTML Text"; smtpClient.Send(message); } catch (Exception ex) { lblmsg.Text = "ERROR : " + ex.Message; } this code works fine but mail is not been send. Thanks in Advance Elizabeth
-
Sum the CountsHi All, Iam new to database. Here iam using sql server 2000. i want to sum the counts from a table. I need this to calculate the employees who have come late in a week/month. Example: I have table such as Table1:tbl_attandence(it contains the employee id and the intimings and outtime) Fields:empcode,intime,outime Eg: EMP001,11/1/2011 09:30:45 AM,11/30/2011 06:30:15 PM I am attaching my code such that it return the count but iam unable to sum the values because it is showing the result as shown below DECLARE @actualTime DATETIME DECLARE @lateTime DATETIME SELECT @actualTime = '9:41' Select @lateTime ='10:00' select count(convert(varchar,intime,105)) as dates,CONVERT(VARCHAR(5),intime,108) AS Hours from tbl_attendance where empcode='EMP001'; and intime between '2011-11-01' and '2011-11-30' and CONVERT(VARCHAR(5),intime,108) >=@actualTime and CONVERT(VARCHAR(5),intime,108) <= @lateTime group by CONVERT(VARCHAR(5),intime,108) OytPut: days intime 1 09:41 1 09:44 1 09:46 2 09:53 1 09:54 Now i need to sum all the days and get the sum as 7 Please suggest that how can i do this task any help will be appreciated
-
Get start dateHi, select empcode,name,(counts+2) as leaves from (select a.empcode,b.name,count(*) as counts from tbl_leaveentry a,tbl_emp b where a.empcode=b.empcode and a.empcode='EMP001' and a.entrydate between DATEADD(d,-2,'12/8/2011') and '12/8/2011' group by a.empcode,b.name) as c where (counts+2) =3 The above code generates the report of the employee who have taken leave more than 3 days from the selected dates but i need to get the start date of the leave applied by the employee eg: 12/1/2011 to 12/8/2011 Thanks in advance
-
Get start dateHi all, DECLARE @holidayCount AS int, @startDate AS datetime, @endData AS datetime, @empCode AS VARCHAR(20) SET @startDate='12/6/2011 00:00:00.000' SET @endDate='12/8/2011 23:59:59.997' SET @empCode='EMP001' SET @holidayCount=(SELECT COUNT(*) FROM tbl_holidays WHERE holidays BETWEEN @startDate AND @endDate) --I am assuming that 'holidays' is a datetime field/column SELECT empCode, name, (Counts + @holidayCount) As holidayCounts FROM ( SELECT a.empCode, b.name, (Count(*) as Counts FROM tbl_leaveentry a,tbl_emp b WHERE a.empCode=b.empCode AND a.empCode=@empCode AND a.entryDate @startDate and @endDate GROUP BY by a.empCode,b.name ) AS temp WHERE Counts + @holidayCount>3 From the above query i got the count but now i need to get the start date of the leave that an employee had applied. eg. 'EMP001' had applied leave from 12/1/2011 to 12/8/2011 but i have only one date option that is the end date. once you select the date option like 12/8/2011 it searches the dates from 2days before like 12/6/2011 and 12/8/2011 and returns the employees who have taken leaves continuously but i need to get the start date of the leave applied by the employee. eg. EMP001 had applied leave from 12/1/2011 to 12/8/2011 Please suggest that how can i do this task any help will be appreciated
-
Sum the counts from two different tablesHi SilimSayo, Thank you so much for the query it matches my result perfectly.
-
Sum the counts from two different tablesHi All, Iam new to database. Here iam using sql server 2000. i want to sum the counts from two different tables. I need this to calculate the employees who have taken continuous leaves in a week/month. Example: I have three table such as Table1:tbl_attandence(it contains the employee id and the intimings and outtime) Fields:empcode,intime,outime Eg: EMP001,11/24/2011 09:30:45 AM,11/24/2011 04:30:15 PM Table2:tbl_leaveentry(it contains the leave dates taken by an employee) Fields:empcode,entrydate Eg: EMP001,11/25/2011 Table3:tbl_holidays(it contains the list of holidays such as sunday,saturday,chrismas,newyear....) Fields:holidays,days Eg: 11/25/2011,sunday I am attaching my code such that it return the sum but iam unable to return the employee name and id because it is showing the result as null as the holidays does not match please help me in completion of process select sum(counts) from( select a.empcode as empcode,b.name,count(*) as counts from tbl_leaveentry a,tbl_emp b where a.empcode=b.empcode and a.empcode='EMP001' and a.entrydate between '11/24/2011'; and '11/27/2011' group by a.empcode,b.name union select null,null,count(*) as counts from tbl_holidays where holidays between '11/24/2011' and '11/27/2011' ) as c having sum(counts)>=3 the above code returns correct sum but if i add name before the sum and execute the result is not been summed because holidays does not match with the leaves Please suggest that how can i do this task any help will be appreciated