15,907,492 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by satheeshkumar chinnadurai (Top 73 by date)
satheeshkumar chinnadurai
29-Feb-16 9:06am
View
I AM NOT GETTING
Need output like that
A1 B1
A1 B2
A1 B3
A1 B4
A2 b1
A2 B2
CAN YOU PLEASE HELP ME...
satheeshkumar chinnadurai
25-Jan-16 7:44am
View
ALTER PROCEDURE [dbo].[p]
@Country INT,
@no_of_pass INT
AS
BEGIN
CREATE TABLE #temp1(id INT IDENTITY(1,1),SeatColumn INT,Seatrow INT,StartingPlace varchar(100),DestinationPlace varchar(100),Seatarr_Id int )
CREATE TABLE #outputdata(id INT IDENTITY(1,1),SeatColumn INT,Seatrow INT,StartingPlace varchar(100),DestinationPlace varchar(100),Seatarr_Id int )
insert into #temp1
SELECT
fsh.SeatColumn,Seatrow,sp.Placename as StartingPlace,st.Placename as DestinationPlace,fsh.Seatarr_Id
FROM FlightAvaliablity fa
Inner JOIN SourcePlace sp on fa.DestinationPlaceID =sp.PlaceID
LEFT JOIN SourcePlace st on fa.StartingPlaceID =st.PlaceID
Inner JOIN FlightSeatSize fsh on fsh.FlightAva_ID =fa.FlightAva_ID
WHERE sp.Countryid=@Country and fsh.BookedStatus=0
Declare @initcount int,@lastcount int
Declare @RowInit INt,@c INT, @RowCount INT
declare @t varchar(max),@SeatColumn int ,@Seatrow int,@SeatColumnprev int ,@Seatrowprev int,@match int
set @RowInit=1
select @c = count(1)
from #temp1
while(@RowInit<=@c)
begin
select @Seatrow = Seatrow
from #temp1
where id = @RowInit
if(@RowInit = 1)
begin
select @SeatColumn = SeatColumn
from #temp1
where id = @RowInit
set @SeatColumnprev = @SeatColumn
SET @Seatrowprev = @Seatrow
end
else
begin
-- print @SeatColumn
if(@Seatrow = @Seatrowprev)
begin
select @SeatColumn = SeatColumn
from #temp1
where id = @RowInit
if(@SeatColumn = @SeatColumnprev)
begin
print 'd '
end
else
begin
Declare @count int
set @count =1
select @SeatColumn = SeatColumn
from #temp1
where id = @RowInit AND Seatrow =@Seatrow
WHILE(@no_of_pass > @count )
BEGIN
IF (@count =1)
BEGIN
select @initcount=id from #temp1 where id = @RowInit AND Seatrow =@Seatrow
--select @SeatColumn = SeatColumn
END
IF (@count =@no_of_pass)
BEGIN
select @lastcount=id from #temp1 where id = @RowInit AND Seatrow =@Seatrow
--select @SeatColumn = SeatColumn
END
IF(@SeatColumn = @SeatColumnprev+1)
BEGIN
Insert into #outputdata
select SeatColumn,Seatrow,StartingPlace,DestinationPlace,Seatarr_Id from #temp1 where id = @RowInit AND Seatrow =@Seatrow
select @SeatColumn = SeatColumn
from #temp1
where id = @RowInit AND Seatrow =@Seatrow
END
ELSE
BEGIN
select @SeatColumnprev = SeatColumn
from #temp1
where id = @RowInit AND Seatrow =@Seatrow
END
SET @count =@count+1
END
END
--
END
ELSE
BEGIN
SET @Seatrowprev =@Seatrowprev +1
END
END
SET @RowInit =@RowInit +1
END
print @initcount
select * from #temp1
select * from #outputdata
drop table #outputdata
drop table #temp1
END
satheeshkumar chinnadurai
23-Jan-16 8:05am
View
USE [Satrugan]
GO
/****** Object: StoredProcedure [dbo].[sp_print_flight_report] Script Date: 02/01/2016 18:45:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROC [dbo].[sp_print_flight_report]
@flight_no int
AS
BEGIN
select Firstname
from
UserDetails u inner join Ticket t on t.CreatedBy= u.userID
inner join FlightAvaliablity fa on t.TravelFlightAva_ID=fa.FlightAva_ID
Where fa.flightID=@flight_no
Select f.Fightno,PersonName,sp.Placename as startingplace
,sp1.Placename As deptureplace ,ts.Fare
from TicketSheet ts
inner join Ticket t on ts.TicketID=t.TicketID
inner join FlightAvaliablity fa on t.TravelFlightAva_ID=fa.FlightAva_ID
inner join SourcePlace sp on sp.PlaceID = ts.StartingPlaceID
inner join SourcePlace sp1 on sp1.PlaceID = ts.DepaturePlaceID
inner join Flights f on fa.flightID=f.flightID
--inner join FilghtSheets fcs on fcs.FlightAva_ID=fa.FlightAva_ID
Where f.flightID=@flight_no
END
GO
/****** Object: StoredProcedure [dbo].[search_flight_availability_report] Script Date: 02/01/2016 18:45:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[search_flight_availability_report]
@from_date DATETIMe
AS
BEGIN
select f.Fightno, fa.FlightID,t.TotalSheetSize,fa.TotalSeatCapacity,fa.TotalSeatCapacity-t.TotalSheetSize AS Remainingseat ,StartingTime
from Flights f
inner join
FlightAvaliablity fa
on f.FlightID = fa.FlightID
inner join Ticket t on t.TravelFlightAva_ID= fa.FlightAva_ID
Where CONVERT(VARCHAR(10),StartingDate,110) =CONVERT(VARCHAR(10),@from_date,110)
order by fa.FlightID
END
GO
/****** Object: StoredProcedure [dbo].[search_flight_availability] Script Date: 02/01/2016 18:45:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[search_flight_availability]
@from_destination INT,
@to_destination INT,
@from_date DATETIME,
@to_date DATETIME,
@no_of_pass INT
AS
BEGIN
CREATE TABLE #temp(id INT IDENTITY(1,1),FlightID INT,StartingPlaceID INT ,TotalSeatCapacity INT ,FlightAva_ID INT,DestinationPlaceID INT,StartingDate DATETIME, DestinationDate DATETIME)
insert into #temp
select FlightID ,TotalSeatCapacity ,FlightAva_ID,StartingPlaceID ,DestinationPlaceID ,StartingDate , DestinationDate
from FlightAvaliablity
where StartingPlaceID = @from_destination
AND DestinationPlaceID = @to_destination
AND CONVERT(VARCHAR(10),StartingDate,110) = CONVERT(VARCHAR(10),@from_date,110)
AND CONVERT(VARCHAR(10),DestinationDate,110) = CONVERT(VARCHAR(10),@to_date,110)
ORDER BY FlightID
-- select *
--from #temp
DECLARE @s INT
DECLARE @c INT
SET @s = 1
SELECT @c = COUNT(1)
FROM #temp
WHILE(@s <= @c)
BEGIN
declare @FlightID int ,@Seatrow int
--declare @TotalSeatCapacity int
declare @FlightAva_ID int
SELECT @FlightID = FlightID
--,
--@TotalSeatCapacity = TotalSeatCapacity ,
,@FlightAva_ID = FlightAva_ID
from #temp
where id = @s
--select @FlightID --,@TotalSeatCapacity ,@FlightAva_ID
CREATE TABLE #temp1(id INT IDENTITY(1,1),FlightID INT, AvailabityRow int)
select top 1 @Seatrow = Seatrow
from FlightSeatSize
where FlightID = @FlightID
order by Seatrow desc
declare @start int
set @start = 1
while(@start < = @Seatrow)
begin
--,@count@ int
--set @
-- if()
declare @s1 int, @c1 int
set @s1 = 1
select @c1 = count (1)
from FlightSeatSize
where FlightID = @FlightID and Seatrow = @Seatrow
declare @isAv int
set @isAv = 0
while(@s1 < = @c1)
begin
if exists( select 1 from TicketSheet where flightId = @FlightID and SeatRow = @start and SeatColumn = @s1 and FlightTravAreaID = @FlightAva_ID )
begin
set @isAv = @isAv+ 1
end
else
begin
if (@isAv > 0)
begin
set @isAv = @isAv - 1
end
end
SET @s1 = @s1 + 1
end
if (@isAv > 1)
begin
insert into #temp1
select @FlightID,@start
end
set @start =
satheeshkumar chinnadurai
28-Aug-15 6:54am
View
can give me example please
satheeshkumar chinnadurai
13-Aug-15 4:34am
View
ok thanks
satheeshkumar chinnadurai
12-Aug-15 12:30pm
View
but i need run single source code but different database connection depends upon the first name so. is it possible
satheeshkumar chinnadurai
21-Jul-15 6:46am
View
AND ((@FromCallDateTime IS NULL AND @ToCallDateTime IS NULL)OR (t1.CallDateTime) BETWEEN Convert(DateTime,@FromCallDateTime) AND Convert(DateTime,@ToCallDateTime))
AND ((@FromNextCallDateTime IS NULL AND @ToNextCallDateTime IS NULL)OR (t1.NextCallDateTime) BETWEEN Convert(DateTime,@FromNextCallDateTime) AND Convert(DateTime,@ToNextCallDateTime))
satheeshkumar chinnadurai
20-Jul-15 0:57am
View
DateTime d = dtpDate.Value;
DateTime t = dtpTime.Value;
DateTime dtCombined = new DateTime(d.Year, d.Month, d.Day, t.Hour, t.Minute, t.Second);
satheeshkumar chinnadurai
20-Jul-15 0:56am
View
AND ((@FromCallDateTime IS NULL AND @ToCallDateTime IS NULL)OR (t1.CallDateTime) BETWEEN Convert(DateTime,@FromCallDateTime) AND Convert(DateTime,@ToCallDateTime))
satheeshkumar chinnadurai
14-Jul-15 7:56am
View
ALTER PROCEDURE sptextsave
@LeaveID int,
@TechinisionID int,
@StartDate datetime,
@EndDate datetime,
@Leavetype int
AS
BEGIN
DECLARE @mErrorNumber AS INTEGER
DECLARE @mAlreadyAppliedCount AS INTEGER
DECLARE @mErrorDescription AS VARCHAR(MAX)
IF (@StartDate < GETDATE())
BEGIN
SET @mErrorDescription='Start Date greater than current date'
RAISERROR(@mErrorDescription,16,1)
RETURN
END
IF (@EndDate < GETDATE())
BEGIN
PRINT Convert(VARCHAR(30),@StartDate ,120)
SET @mErrorDescription='Start Date greater than end date'
RAISERROR(@mErrorDescription,16,1)
RETURN
END
IF (@StartDate = @EndDate )
BEGIN
PRINT Convert(VARCHAR(30),@StartDate ,120)
SET @mErrorDescription='Start Date greater than end date'
RAISERROR(@mErrorDescription,16,1)
RETURN
END
IF (@EndDate < @StartDate)
BEGIN
PRINT Convert(VARCHAR(30),@StartDate ,120)
SET @mErrorDescription='Start Date greater than end date'
RAISERROR(@mErrorDescription,16,1)
RETURN
END
IF (SELECT COUNT(*) FROM text2 WHERE @StartDate BETWEEN StartDate AND EndDate AND TechinisionID =@TechinisionID)>0
BEGIN
SET @mErrorDescription='Start date you have selected already exits between leave period'
RAISERROR(@mErrorDescription,16,1)
RETURN
END
IF (SELECT COUNT(*) FROM text2 WHERE @EndDate BETWEEN StartDate AND EndDate AND TechinisionID =@TechinisionID)>0
BEGIN
SET @mErrorDescription='End date you have selected already exits between leave period'
RAISERROR(@mErrorDescription,16,1)
RETURN
END
IF @LeaveID=0
BEGIN
INSERT INTO [dbo].[text2]
([TechinisionID]
,[StartDate]
,[EndDate]
,[Leavetype]
,[CreatedDate]
,[ModifiedDate])
VALUES
(@TechinisionID,
@StartDate,
@EndDate,
@Leavetype,
GETDATE(),
GETDATE())
END
ELSE
UPDATE [dbo].[text2]
SET [TechinisionID] = @TechinisionID,
[StartDate] = @StartDate,
[EndDate] = @EndDate,
[Leavetype] = @Leavetype,
[ModifiedDate] = GETDATE()
WHERE LeaveID =@LeaveID
END
GO
satheeshkumar chinnadurai
14-Jul-15 3:02am
View
-------------------------------
DECLARE @StatDate Datetime
Declare @CurrentDate Datetime
Set @StatDate = '2015-07-13 23:55:32.850'
SET @CurrentDate =GETDATE()
PRINT '@CurrentDate '+ CAST(Convert(VARCHAR(30), @CurrentDate ,120) AS VARCHAR(37))
PRINT 'StatDate '+ CAST(Convert(VARCHAR(30), @StatDate ,120) AS VARCHAR(37))
IF ((SeLECT Convert(VARCHAR(30), @CurrentDate ,120)) < (SeLECT Convert(VARCHAR(30), @StatDate ,120)))
BEGIN
PRINT 'sss'
END
ELSE
BEGIN
PRINT 'aa'
END
Go
satheeshkumar chinnadurai
14-Jul-15 0:31am
View
AND (@CompanyID IS NULL OR (t1.CompanyID = @CompanyID AND t1.CaseStatus!='6D5BD963-2233-4329-BD09-F8C03C12E86E'))
AND (@UserID IS NULL OR (t1.AssignedTo = @UserID) OR ((t1.CreatedBy = @UserID)) OR (t1.CaseID IN (Select CaseID from CaseShares Where IsDeleted=0 AND UserID=@UserID)))
AND (LTRIM(RTRIM(@AssignedTo)) IS NULL OR t1.AssignedTo LIKE LTRIM(RTRIM(@AssignedTo)) + '%')
satheeshkumar chinnadurai
3-Jul-15 1:49am
View
Azure container having one word document that document need created on run time.
Created document convert to pdf document through c# code Microsoft.Office.Interop.Word this class not supporting in azure
satheeshkumar chinnadurai
2-Jul-15 0:42am
View
Word.Interop that namespace not supporting windows azure.
satheeshkumar chinnadurai
1-Jul-15 1:29am
View
Hi Sir you Know any idea? please share me
satheeshkumar chinnadurai
1-Jul-15 1:08am
View
That File was docment so i need to read a inside word document can help me sir?
satheeshkumar chinnadurai
1-Jul-15 1:04am
View
That File was docment so i need to read a inside word document can help me sir?
satheeshkumar chinnadurai
1-Jul-15 1:03am
View
How can i change normal text sir
satheeshkumar chinnadurai
30-Jun-15 3:16am
View
can you help any expmple?
satheeshkumar chinnadurai
30-Jun-15 3:14am
View
i am getting 404 Error Please help me
satheeshkumar chinnadurai
30-Jun-15 3:06am
View
Thanks I Am trying now
satheeshkumar chinnadurai
24-Jun-15 1:28am
View
I need every page footer what i want to....
satheeshkumar chinnadurai
24-Jun-15 1:28am
View
I need every page footer what i want to....
satheeshkumar chinnadurai
8-Apr-15 1:41am
View
Deleted
...
satheeshkumar chinnadurai
30-Apr-14 7:21am
View
http://findicons.com/search/cow
satheeshkumar chinnadurai
30-Apr-14 5:35am
View
MessageBox.Show(dateTimePicker1.Value.ToString("yyyy-MM-dd"));
satheeshkumar chinnadurai
30-Apr-14 5:20am
View
finally i got solution
satheeshkumar chinnadurai
30-Apr-14 5:20am
View
objApp.Visible = true;
ProcessStartInfo startInfo = new ProcessStartInfo("D:\\DMR.xlsx");
Process.Start(startInfo);
satheeshkumar chinnadurai
30-Apr-14 4:53am
View
That excel file opened but i am created excel not opened..... plz help me
satheeshkumar chinnadurai
25-Apr-14 8:35am
View
SELECT Shift, Date,
(CASE WHEN Shift=1 THEN 'Morning' WHEN Shift=2 THEN 'Evening'END) AS ShiftName,
SUM(ISNULL(Liter,0))
AS TotalLiters,SUM(CAN) as CAN
FROM dbo.Purchase
WHERE Date='2014-05-22' AND Shift = 1
GROUP BY Liter, Date, Shift
UNION
SELECT Shift, Date,
(CASE WHEN Shift=1 THEN 'Morning' WHEN Shift=2 THEN 'Evening'END) AS ShiftName,
SUM(ISNULL(Liter,0))
AS TotalLiters ,SUM(CAN) as CAN
FROM dbo.Purchase
WHERE Date= dateadd(day,datediff(day,1,'2014-05-22'),0) AND Shift = 2
GROUP BY Liter, Date, Shift
satheeshkumar chinnadurai
23-Apr-14 8:13am
View
try
{
MailMessage mail = new MailMessage();
mail.To.Add("xxx@gmail.com");
mail.To.Add("xxx@gmail.com");
mail.From = new MailAddress("x@gmail.com");
mail.Subject = "TestMail";
string Body = "Vel";
mail.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient("localhost", 25);
smtp.Host = "smtp.gmail.com"; //Or Your SMTP Server Address
smtp.Credentials = new System.Net.NetworkCredential("xxx@gmail.com", "xxxxxxx");
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
smtp.EnableSsl = true;
Attachment data = new Attachment(@"D:\DMR.xlsx");
mail.Attachments.Add(data);
smtp.Send(mail);
//MessageBox.Show("Mail Send");
}
catch (Exception ex)
{
// MessageBox.Show(ex.Message);
}
satheeshkumar chinnadurai
23-Apr-14 8:06am
View
objSheet.UsedRange.Borders.Color = System.Drawing.Color.Black;
satheeshkumar chinnadurai
23-Apr-14 8:06am
View
Microsoft.Office.Interop.Excel.Range Sno = objSheet.get_Range("A4:B4", System.Type.Missing);
Sno.EntireColumn.ColumnWidth = 3;
Microsoft.Office.Interop.Excel.Range eSocCode = objSheet.get_Range("B4:C4", System.Type.Missing);
eSocCode.EntireColumn.ColumnWidth = 8;
Microsoft.Office.Interop.Excel.Range eSocName = objSheet.get_Range("C4:D4", System.Type.Missing);
eSocName.EntireColumn.ColumnWidth = 20;
Microsoft.Office.Interop.Excel.Range emSample = objSheet.get_Range("D4:E4", System.Type.Missing);
emSample.EntireColumn.ColumnWidth = 6;
Microsoft.Office.Interop.Excel.Range emCan = objSheet.get_Range("E4:F4", System.Type.Missing);
emCan.EntireColumn.ColumnWidth = 4;
Microsoft.Office.Interop.Excel.Range emLiter = objSheet.get_Range("F4:G4", System.Type.Missing);
emLiter.EntireColumn.ColumnWidth = 7;
Microsoft.Office.Interop.Excel.Range emFat = objSheet.get_Range("G4:H4", System.Type.Missing);
emFat.EntireColumn.ColumnWidth = 4;
Microsoft.Office.Interop.Excel.Range emSnf = objSheet.get_Range("H4:I4", System.Type.Missing);
emSnf.EntireColumn.ColumnWidth = 3;
Microsoft.Office.Interop.Excel.Range eeSample = objSheet.get_Range("I4:J4", System.Type.Missing);
eeSample.EntireColumn.ColumnWidth = 6;
Microsoft.Office.Interop.Excel.Range eeCan = objSheet.get_Range("J4:K4", System.Type.Missing);
eeCan.EntireColumn.ColumnWidth = 4;
Microsoft.Office.Interop.Excel.Range eeLiter = objSheet.get_Range("K4:L4", System.Type.Missing);
eeLiter.EntireColumn.ColumnWidth = 7;
Microsoft.Office.Interop.Excel.Range eeFat = objSheet.get_Range("L4:M4", System.Type.Missing);
eeFat.EntireColumn.ColumnWidth = 4;
Microsoft.Office.Interop.Excel.Range eeSnf = objSheet.get_Range("M4:N4", System.Type.Missing);
eeSnf.EntireColumn.ColumnWidth = 3;
satheeshkumar chinnadurai
23-Apr-14 7:44am
View
Deleted
objSheet.get_Range("A2", "C2").Style.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter;
objSheet.get_Range("A2", "M2").Font.Bold = true;
satheeshkumar chinnadurai
23-Apr-14 7:44am
View
Deleted
Microsoft.Office.Interop.Excel.Range Sno = objSheet.get_Range("A4:B4", System.Type.Missing);
Sno.EntireColumn.ColumnWidth = 3;
Microsoft.Office.Interop.Excel.Range eSocCode = objSheet.get_Range("B4:C4", System.Type.Missing);
eSocCode.EntireColumn.ColumnWidth = 8;
Microsoft.Office.Interop.Excel.Range eSocName = objSheet.get_Range("C4:D4", System.Type.Missing);
eSocName.EntireColumn.ColumnWidth = 20;
Microsoft.Office.Interop.Excel.Range eSample = objSheet.get_Range("D4:E4", System.Type.Missing);
eSample.EntireColumn.ColumnWidth = 6;
Microsoft.Office.Interop.Excel.Range eCan = objSheet.get_Range("E4:F4", System.Type.Missing);
eCan.EntireColumn.ColumnWidth = 4;
Microsoft.Office.Interop.Excel.Range eLiter = objSheet.get_Range("F4:G4", System.Type.Missing);
eLiter.EntireColumn.ColumnWidth = 7;
Microsoft.Office.Interop.Excel.Range eFat = objSheet.get_Range("G4:H4", System.Type.Missing);
eFat.EntireColumn.ColumnWidth = 4;
Microsoft.Office.Interop.Excel.Range eSnf = objSheet.get_Range("H4:I4", System.Type.Missing);
eSnf.EntireColumn.ColumnWidth = 3;
satheeshkumar chinnadurai
22-Apr-14 8:38am
View
internal sealed class Settings
{
private static Settings _instance = null;
private static object _lock = new object();
private int _UnionCode;
public int UnionCode { get { return _UnionCode; } }
private string _UnionName;
private string _SocDetails;
public string UnionName { get { return _UnionName; } }
public string SocDetails { get { return _SocDetails; } }
private Settings() // Made default constructor as private
{
_UnionCode = 20;
_UnionName = "Sa";
_SocDetails = "Sa";
}
public static Settings Instance
{
get
{
lock (_lock)
{
_instance = _instance ?? new Settings();
return _instance;
}
}
}
}
satheeshkumar chinnadurai
22-Apr-14 8:38am
View
internal static void GenerateExcel(DataTable dt)
{
Microsoft.Office.Interop.Excel.Application objApp = new Microsoft.Office.Interop.Excel.Application();
Microsoft.Office.Interop.Excel.Workbooks objBooks = objApp.Workbooks;
Microsoft.Office.Interop.Excel.Workbook objBook = objBooks.Add(Missing.Value);
Microsoft.Office.Interop.Excel.Worksheet objSheet = null;
Microsoft.Office.Interop.Excel.Range range = null;
if (dt.Rows.Count > 0)
{
objSheet = (Microsoft.Office.Interop.Excel.Worksheet)objBook.Worksheets.Add(Missing.Value, Missing.Value, Missing.Value, Missing.Value);
((Microsoft.Office.Interop.Excel.Worksheet)objBook.Sheets[1]).Select(Missing.Value);
int row = 0;
//Headers
objSheet.Cells[row + 1, 13] = Settings.Instance.UnionName;
objSheet.get_Range("A1", "M1").Merge(Type.Missing);
row = row + 1;
objSheet.Cells[row + 1, 3] = "Society Details";
objSheet.get_Range("A2", "C2").Merge(true);
objSheet.Cells[row + 1, 7] = "Morning";
objSheet.get_Range("D2", "H2").Merge(true);
objSheet.Cells[row + 1, 10] = "Evening";
objSheet.get_Range("I2", "M2").Merge(true);
row = row + 1;
objSheet.Cells[row + 1, 1] = "SNo";
objSheet.Cells[row + 1, 2] = "SocCode";
objSheet.Cells[row + 1, 3] = "SocName";
objSheet.Cells[row + 1, 4] = "Sample";
objSheet.Cells[row + 1, 5] = "Can";
objSheet.Cells[row + 1, 6] = "Liter";
objSheet.Cells[row + 1, 7] = "FAT";
objSheet.Cells[row + 1, 8] = "SNF";
objSheet.Cells[row + 1, 9] = "Sample";
objSheet.Cells[row + 1, 10] = "Can";
objSheet.Cells[row + 1, 11] = "Liter";
objSheet.Cells[row + 1, 12] = "FAT";
objSheet.Cells[row + 1, 13] = "SNF";
foreach (DataRow dr in dt.Rows)
{
row++;
for (int col = 0; col < dt.Columns.Count; col++)
{
if (int.Parse(dr["Shift"].ToString()) == 1)
{
objSheet.Cells[row + 1, 1] = dt.Columns.Count;
objSheet.Cells[row + 1, 2] = dr["SocNo"].ToString();
objSheet.Cells[row + 1, 5] = dr["CAN"].ToString();
objSheet.Cells[row + 1, 6] = dr["FAT"].ToString();
objSheet.Cells[row + 1, 7] = dr["snf"].ToString();
}
}
}
objBook.Close(true, @"D:\DMR.xlsx", Missing.Value);
objBooks.Close();
}
}
}
satheeshkumar chinnadurai
26-Mar-14 3:20am
View
Not UserID - CompanyID some where i am using null values some where assign value
satheeshkumar chinnadurai
19-Mar-14 8:23am
View
us.UserTypeID = Int16.Parse(reader["UserTypeID"].ToString()); i got solution
satheeshkumar chinnadurai
19-Mar-14 8:22am
View
us.UserTypeID = Int16.Parse(reader["UserTypeID"].ToString()); finally i got solutions
satheeshkumar chinnadurai
14-Mar-14 7:51am
View
o == DBNull.Value
false
o
1
i Checked immdiate window return this value
satheeshkumar chinnadurai
14-Mar-14 7:43am
View
i cann't understand
satheeshkumar chinnadurai
14-Mar-14 6:56am
View
Specified cast is not valid. again i am getting same error this line us.UserTypeID = (Int16) o;
satheeshkumar chinnadurai
14-Mar-14 6:44am
View
reader["UserTypeID"]; but i checked immdiate window it coming
satheeshkumar chinnadurai
14-Mar-14 6:41am
View
same error i am getting
satheeshkumar chinnadurai
14-Mar-14 6:37am
View
tinyint
satheeshkumar chinnadurai
10-Mar-14 6:09am
View
thanks....
satheeshkumar chinnadurai
3-Mar-14 8:17am
View
thanks...
satheeshkumar chinnadurai
3-Mar-14 7:38am
View
1)in process:
2)state server:
3)sql server:
4)custom server: can give one example....... plz explain with single word........
satheeshkumar chinnadurai
3-Mar-14 7:28am
View
thanks
satheeshkumar chinnadurai
2-Mar-14 0:32am
View
sorry sir which situation can use interface...
satheeshkumar chinnadurai
2-Mar-14 0:28am
View
Sorry....
Please give any real time example
satheeshkumar chinnadurai
25-Feb-14 23:58pm
View
give any other option plz
satheeshkumar chinnadurai
25-Feb-14 23:57pm
View
i have implemented IRequiresSessionState interface in the handler. Still the error "object referance not set to an instant of an object " persists
I already tried this way but it did not work for me. :(
in temp.aspx file i assigned value to session:
Context.Session["temp"] = _idalbum;
and in .ashx file i tried this:
string allfolder = context.Session["temp"].ToString();
which caused error -object referance not set to an instant of an object because session is null.
satheeshkumar chinnadurai
25-Feb-14 1:58am
View
http://www.aspdotnet-suresh.com/2012/12/jquery-uploading-multiple-files-in.html i am using this example my problem... handler inside session value return null values
public class Upload : IHttpHandler, System.Web.SessionState.IRequiresSessionState i used this code that time also i getting same error any one help.....
satheeshkumar chinnadurai
27-Jan-14 5:39am
View
if possible to do windows service give me example.....
satheeshkumar chinnadurai
27-Jan-14 5:05am
View
in mysql database insert one values. i want to insert same value sql server that is only needed
satheeshkumar chinnadurai
27-Jan-14 4:31am
View
1. Have datatbase one for mysql
2. Have datatbase one for sql server 2008
i want to insert one record mysql . at the same time sql server 2008 want to insert how without using windows servicing
satheeshkumar chinnadurai
27-Jan-14 0:33am
View
here having 2 website so i want to work same sesssion 2 website
satheeshkumar chinnadurai
24-Jan-14 5:45am
View
sing (SqlBulkCopy copy = new SqlBulkCopy(cn))
{
copy.ColumnMappings.Add(4,"Dates");
copy.DestinationTableName = "Censis";
copy.WriteToServer(dtExcelRecords);
}
here 4 excel sheet column name
"Dates" is table column name pass like 2012-05-05
satheeshkumar chinnadurai
23-Jan-14 7:15am
View
thanks karthik working fine
satheeshkumar chinnadurai
23-Jan-14 5:27am
View
BusinessDetails objBus = new BusinessDetails();
objBus._businessid = Session["BusinessID"].ToString();
objBus._deletedby = Session["UserID"].ToString();
objBus.DeleteBusinessRegistrationDetails();
here i need to confirmation want to redirect first or second javascript pop message
if ()
{
1 Response.Redirect("ListExhibitorDetails.aspx", false);
}
else
{
2 Response.Redirect("ListBusinessDetails.aspx", false);
}
satheeshkumar chinnadurai
23-Jan-14 5:21am
View
button click event c# i need alert box
satheeshkumar chinnadurai
23-Jan-14 5:08am
View
i got solution
item.Cells[i].Attributes.Add("style", "mso-number-format:\\@"); we need to put double shas symbol
satheeshkumar chinnadurai
23-Jan-14 4:43am
View
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.AddHeader("content-disposition", "attachment;filename=" + fileName + ".xls");
HttpContext.Current.Response.Write("\r\n");
StringWriter stringWriter = new StringWriter();
HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWriter);
DataGrid dataExportExcel = new DataGrid();
dataExportExcel.ItemDataBound += new DataGridItemEventHandler(dataExportExcel_ItemDataBound);
dataExportExcel.DataSource = dt;
dataExportExcel.DataBind();
htmlWrite.WriteLine("<table width='100%' cellspacing='0' cellpadding = '0' border ='0'> <tr> <td width='100%' align='center' colspan='" + NoOfColumns + "'>
" + excelHeaderName + "
</td> </tr> </table>");
foreach (DataGridItem item in dataExportExcel.Items)
{
for (int i = 0; i < item.Cells.Count; i++) // loop through all the cells in grid
item.Cells[i].Attributes.Add("style", "mso-number-format:\@");
}
dataExportExcel.RenderControl(htmlWrite);
StringBuilder sbResponseString = new StringBuilder();
sbResponseString.Append("<html xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:x=\"urn:schemas-microsoft-com:office:excel\" xmlns=\"http://www.w3.org/TR/REC-html40\"> <head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=windows-1252\"><!--[if gte mso 9]><xml><x:excelworkbook><x:excelworksheets><x:excelworksheet><x:name>" + worksheetName + "<x:worksheetoptions><x:panes></xml><![endif]--></head> <body>");
sbResponseString.Append(stringWriter + "</body></html>");
string style = @"<style> .textmode { mso-number-format:\@; } </style>";
HttpContext.Current.Response.Write(style);
HttpContext.Current.Response.Write(sbResponseString.ToString());
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.End();
satheeshkumar chinnadurai
23-Jan-14 4:40am
View
win form or web form?
satheeshkumar chinnadurai
23-Jan-14 4:19am
View
but i am getting same issues again
satheeshkumar chinnadurai
23-Jan-14 3:00am
View
k sir
satheeshkumar chinnadurai
23-Jan-14 2:53am
View
var d=new Date("05/18/2015");this one correct output giving thanks
satheeshkumar chinnadurai
23-Jan-14 2:43am
View
18/05/2016 this date which day
satheeshkumar chinnadurai
9-Oct-12 0:26am
View
Sir I am already try this i got some Error "Could Not load or Asssembly"
satheeshkumar chinnadurai
10-Sep-12 5:48am
View
but page load time i need empty grid sir what can i do plz help sir
satheeshkumar chinnadurai
29-Aug-12 5:25am
View
alert not working sir
Show More