15,892,072 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 Aksh@169 (Top 22 by date)
Aksh@169
5-Jul-18 10:51am
View
I am facing the same issue.However in my case ,I have seen that error is coming when debugging in Google Chrome.Any specific reason ?Help is appreciated
Aksh@169
20-Jun-18 10:55am
View
its sbj_p interface property
Aksh@169
24-Jan-13 1:53am
View
Help me out someone.. i am stuck . .
Aksh@169
14-Apr-11 5:46am
View
I want that when i come back to the page where i selected the items in the listbox, i should find them selected(highlighted) still
Aksh@169
3-Mar-11 6:57am
View
Deleted
Can u pls tell me how to achieve what u have written in ur former idea if my code does the following:
public void automate()
{
string filepath,filename, fileExcel,renamedfile;
string ReportCount = "select count(rs.contactID) from tblReportLOg rs inner join tblContact c on c.contactID = rs.contactID where LogDate >= '2011-01-20 00:00:00.000' and c.email like '%micro%' and rs.contactid not in (39287,39286,27546)";
string UserCount = "select count(distinct(rs.contactID)) from tblReportLOg rs inner join tblContact c on c.contactID = rs.contactID where LogDate >= '2011-01-20 00:00:00.000' and c.email like '%micro%' and rs.contactid not in (39287,39286,27546)";
Random nRandom = new Random(DateTime.Now.Millisecond);
//Create a random file name.
fileExcel = "t" + nRandom.Next().ToString() + ".xls";
filepath = "C:\\test";
filename = filepath + "\\" + "test.xlsx";
renamedfile = System.IO.Path.GetFileNameWithoutExtension(filename);
renamedfile = System.IO.Path.GetPathRoot(filename) + "test\\" + renamedfile + '_' + DateTime.Now.ToString("ddMMyyyy hhmm") + System.IO.Path.GetExtension(filename);
Microsoft.Office.Interop.Excel._Application excelApp = new Microsoft.Office.Interop.Excel.Application();
Excel.Workbook excelWorkbook = excelApp.Workbooks.Add(Type.Missing);
try
{
SqlConnection conn = new SqlConnection();
conn.ConnectionString = ConfigurationManager.AppSettings["Connection"];
SqlCommand cmd = new SqlCommand("select rs.contactID,SurveyType,ModuleName,LogDate from tblReportLOg rs inner join tblContact c on c.contactID = rs.contactID where LogDate >= '2011-01-20 00:00:00.000' and c.email like '%micro%' and rs.contactid not in (39287,39286,27546) order by LogDate ", conn);
SqlCommand cmd1 = new SqlCommand(ReportCount, conn);
SqlCommand cmd2 = new SqlCommand(UserCount, conn);
SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter(cmd);
DataSet d = new DataSet();
mySqlDataAdapter.Fill(d, "dataset");
conn.Open();
string reports = Convert.ToString(cmd1.ExecuteScalar());
string users = Convert.ToString(cmd2.ExecuteScalar());
int sheetIndex = 0;
// Copy each DataTable
foreach (System.Data.DataTable dt in d.Tables)
{
// Copy the DataTable to an object array
object[,] rawData = new object[dt.Rows.Count + 1, dt.Columns.Count];
// Copy the column names to the first row of the object array
for (int col = 0; col < dt.Columns.Count; col++)
{
// if(dt.Columns[col].ColumnName).
rawData[0, col] = dt.Columns[col].ColumnName;
}
// Copy the values to the object array
for (int col = 0; col < dt.Columns.Count; col++)
{
for (int row = 0; row < dt.Rows.Count; row++)
{
rawData[row + 1, col] = dt.Rows[row].ItemArray[col];
}
}
// Calculate the final column letter
string finalColLetter = string.Empty;
string colCharset = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int colCharsetLen = colCharset.Length;
if (dt.Columns.Count > colCharsetLen)
{
finalColLetter = colCharset.Substring((dt.Columns.Count - 1) / colCharsetLen - 1, 1);
}
finalColLetter += colCharset.Substring((dt.Columns.Co
Aksh@169
3-Mar-11 6:52am
View
I tried calling the release after Quit but no use...
Dont know how to resolve it:(
Aksh@169
17-Feb-11 0:53am
View
Hi,
Tried that as well but it didnt help.
While debuggind the same code in windows app its working fine but not in windows service
Aksh@169
16-Feb-11 22:55pm
View
Can u please lemme know how do i achieve the timing requirement i.e triggering at 4 pm on two specified days
Aksh@169
16-Feb-11 22:26pm
View
yes, the data is being retrieved correctly and exported to excel as well. Checked this by implementing the code in windows application. The problem is appearing in Windows service.So it seemed to me that issue is with setting the timer.
Aksh@169
16-Feb-11 12:16pm
View
My requirement is that i need to fetch data frm database and export it to excel.
Next i need to trigger a mail every Tues anf Friday at 4 pm that has the exported excel as its attachment.I have to build Windows Service fr this task.
Please tell me if I am goin off track
Thanks
Aksh@169
16-Feb-11 7:52am
View
Thanks John for making it easy to read..I didnt know how to format it
I am looking for a resolution fr the issue I am facing..changes the start time from app.config with the interval of 3 min..still the same issue:(
Aksh@169
16-Feb-11 2:21am
View
Thanks..it worked this way:)
I am also looking for one more thing if you could suggest something.
I intend to delete the obsolete excels(say last 10 excels) stored at the location specified due to size issue.
Can you please help in this?
Aksh@169
16-Feb-11 1:21am
View
Thanks for your help but I am getting an error which is as below:- Microsoft Office Excel cannot access the file 'test_2/16/2011.xlsx'. There are several possible reasons: • The file name or path does not exist. • The file is being used by another program. • The workbook you are trying to save has the same name as a currently open workbook. Could not find a part of the path 'C:\Windows\system32\test_2\16\2011.xlsx'. The code i have written is as below:
string filepath, filename, fileExcel, renamedfile;
filepath = "C:\\test";
filename = filepath + @"\test.xlsx";
renamedfile = Path.GetFileNameWithoutExtension(filename);
renamedfile = renamedfile += "_" + DateTime.Now.ToShortDateString() + Path.GetExtension(filename);
----logic for generating excel
excelWorkbook.SaveCopyAs(renamedfile);
Any suggestions for this?
Aksh@169
15-Feb-11 5:44am
View
The issue is that I dont know how to schedule it biweekly at a specific time:(
Aksh@169
14-Feb-11 2:08am
View
But when I am clicking the 'Cancel' button of the confirmatory pop up,it is still performing the task of sending emails:(
Aksh@169
7-Feb-11 13:33pm
View
Thanks for your kind reply.....
Aksh@169
6-Feb-11 11:36am
View
i need in asp.net C# Please help me out!!!...
Aksh@169
3-Dec-10 11:54am
View
Any other method..sorry i am not getting image just a small image like icon on the left topmost corner.. ..any other methos
Aksh@169
2-Dec-10 11:51am
View
SO HOW CAN I DO THAT SO HELP...PLEASE
Aksh@169
29-Nov-10 22:40pm
View
STILL IMAGE ICON IS COMING BUT NO IMAGE.....FIRSTLY THERE IS A X ON THE IMAGE...AFTER UPLOADING BTN CLK....IT CHANGES TO ICON OF IMG VERY SMALL....NOT SHOWING ANY IMAGE
Aksh@169
22-Nov-10 3:04am
View
A very thanks for your Reply.....
Aksh@169
21-Nov-10 1:46am
View
Thanks For Your reply.. But again the problem is that i have to concatenate the rows which are of DATA TYPE XML....... please help me out.
Show More