15,886,199 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 daiwuju (Top 10 by date)
daiwuju
8-May-13 11:17am
View
The demo is coded in VS 2012 WPF, and I rewrite in WinForm by VS 2008 and fix a bug in the demo - the client receiving action is not in an independent thread. I am new to C#, not familiar with the difference between Winform and WPF.
daiwuju
11-Mar-13 4:22am
View
In my application, a server or website provides short-message service(SMS) sending function. When a user login by web brower, he/she submits the mobilephone number and the SMS content, both of which are then input into a SQL Server 2008 database. One program running continously on the server reads the SMS infomation from the database and then sends it to a telecommunication operator's SMS Gateway.
daiwuju
11-Mar-13 4:20am
View
Deleted
In my application, a server orwensite provides short-message service(SMS) sending function. When a user login by web brower, he/she submits the mobilephone number and the SMS content, both of which is then input into a SQL Server 2008 database. One program running continously on the server read the mobilephone number and the SMS content from the database and sends it to a telecommunication operator's SMS Gateway.
daiwuju
6-Mar-13 9:16am
View
It is a stupid mistake. The records, which were not be successfully by another application program until 300 seconds after all the records in SGIP_Submit have been sent to the application program, should be put into another table SGIP_Plan. If the resent choice is made, the records in SGIP_Plan should be inserted back to SGIP_Submit and sent again to the application program. But in the code, the records in the SGIP_Plan is inserted back to SGIP_Submit after 300 second when it was sent from SGIP_Submit for the first time. So for a large number records which causes a long sending time, there would be some unsuccessfully processed records which is inserted back after it has been deleted and before all the records have been sent.
daiwuju
4-Mar-13 20:52pm
View
First, I am very sorry for the use of word "fail". The records left in the table has been reduced greatly to about 0.4% when the record count is more than 1200 if your code runs. I think your last question must be the answer to my problem - there must an other stored procedure that does something to the table. I will check the whole project now.
Thanks!
daiwuju
4-Mar-13 7:46am
View
Thank your very much, Mike Meinz. I have tried your code, and failed. Now, I plan to add some code to check whether the SMS_sumit is empty, that is if not empty, do the procession again.
daiwuju
4-Mar-13 4:39am
View
Yes, id is the Primary Key.
daiwuju
23-Oct-12 10:30am
View
Thanks for your suggestion. I rewrite the sorting code, and now it works.
daiwuju
6-Aug-12 21:03pm
View
Could you give me some sample code in C# ?
daiwuju
1-Aug-12 23:29pm
View
Thank you very much for the answer. Your code runs OK!
I don't use ref or out in the method because I have use the following code in the main program, the first if block is used to read file in Excel2007-2010 format(xlsx) by OLEDB (realized in class ClientExcelXML), and the second if block is used to read file in Excel97-2003 format(xls) by ExcelLibrary with the code of class ClientXLS in the question:
-------------------------------------------------------------------
if (openFile.FileName.EndsWith(".xlsx"))
{
ClientExcelXML ClientNewXML = new ClientExcelXML();
ClientNewXML.ExcelInput(openFile.FileName, dataTable_Excel);
}
else if (openFile.FileName.EndsWith(".xls"))
{
ClientXLS ClientNewXLS = new ClientXLS();
ClientNewXLS.ExcelInput(openFile.FileName, dataTable_Excel);
}
-------------------------------------------------------------------
The code of class ClientExcelXML is:
-------------------------------------------------------------------
class ClientExcelXML
{
public void ExcelInput(string FileOpen, DataTable dataTable_Excel)
{
string strExcelFile = FileOpen;
strExcelFile =string.Format("Provider = Microsoft.ACE.OLEDB.12.0; Data Source = {0}; Extended Properties = \"Excel 12.0 Xml; HDR = YES; IMEX = 1; TypeGuessRows = 0; ImportMixedTypes = Text\";",strExcelFile);
OleDbConnection conOLDB = new OleDbConnection(strExcelFile);
conOLDB.Open();
DataTable dataTable_ExcelSheet = conOLDB.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
string sheetName = dataTable_ExcelSheet.Rows[0]["TABLE_NAME"].ToString().Trim();
string selectstr = string.Format("SELECT * FROM [{0}]", sheetName);
OleDbCommand selectCommand = new OleDbCommand(selectstr, conOLDB);
OleDbDataAdapter daExcel = new OleDbDataAdapter();
daExcel.SelectCommand = selectCommand;
daExcel.Fill(dataTable_Excel);
conOLDB.Close();
conOLDB.Dispose();
}
}
-------------------------------------------------------------------
The first if block runs Ok, but the second never runs. It seems to me there is no difference between these two if block, and this made me confused until now. Could you give me some tip?
Show More