16,014,748 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 .NET 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 2gizzo (Top 15 by date)
2gizzo
18-Feb-11 2:44am
View
Thank you very much the above code worked with no problem, just one modification just realized that I was opening the wrong connection object, I was supposed to open sConnection instead objConnection (objConnection was for the excel file and sConnection was for the SqlConnection)
2gizzo
17-Feb-11 10:37am
View
the user is sa which has full access rights anyway right
2gizzo
17-Feb-11 9:32am
View
How would I go about doing the same task using LINQ? can you give some examples?
2gizzo
17-Feb-11 7:20am
View
Already did but I modified it to use a stored procedure instead of SQL INSERT but its not inserting, what surprises me the most is why am I not getting an error of any sort?
2gizzo
17-Feb-11 5:10am
View
sConnection and sCommand is initialized in the constructor here is how the constuctor looks
<pre>
// Constructor definition
public Uploader(string path, string connectStr)
{
this.path = path;
ConnectionString = connectStr;
constr = @"Provider=Microsoft.ACE.OLEDB.12.0;
Data Source=" + path + @";Extended Properties=""Excel 12.0;HDR=YES;""";
objConnection = new OleDbConnection(constr);
objCommand = new OleDbCommand();
objCommand.Connection = objConnection;
objCommand.CommandType = CommandType.Text;
objCommand.CommandText = "SELECT * FROM [Sheet1$]";
sConnection = new SqlConnection(connectStr);
sCommand = new SqlCommand();
sCommand.Connection = sConnection;
sCommand.CommandType = CommandType.StoredProcedure;
sCommand.CommandText = "spAddDebtor";
sCommand.CommandTimeout = 2000;
size = 0;
rowsaffected = 0;
// Initialize collections
names = new List<string>();
phones = new List<string>();
addresses = new List<string>();
contactPeople = new List<string>();
}
</pre>
2gizzo
1-Feb-11 7:36am
View
Thanks alot thats exactly what I wanted
2gizzo
1-Feb-11 5:17am
View
WPF would be okay as well so how would I go about it in WPF
2gizzo
26-Oct-10 4:08am
View
Once again I appreciate the effort this worked perfectly so now i dont know which to use between the two solutions but thanks alot!
2gizzo
26-Oct-10 3:51am
View
I didnt think it made a difference where posts goes but I understand now from now on I will be adding replies as a comment. My apologies!
2gizzo
26-Oct-10 3:44am
View
Brilliant! This worked perfectly thank you very much.
2gizzo
6-Oct-10 14:36pm
View
Okay sometimes when you debug an application a copy of the database is sent to \<your_project_name>\bin\Debug it could be that that the one its saving to and when you run your app it reference the one in your project folder so delete the one in your project folder (but make a backup copy before you do) and leave the one in the debug folder then try run it again and see if that solves it!
2gizzo
6-Oct-10 13:41pm
View
What version of visual studio/sql are you using?
2gizzo
4-Oct-10 15:04pm
View
Actually i think I misunderstood you. When i created the scalar functions they were doin the exact same thing as the sproc before but now i have sorted it out tho not exactly using scalar functions but the logic is exactly the same as you have written above something lyk this
<pre>
SELECT (dbo.AvgQ26.Q26 + dbo.AvgQ2) / 2 AS [integrity], (dbo.AvgQ13.Q13 + dbo.AvgQ29.Q29)/ 2 [Leadership]
FROM dbo.AvgQ25 CROSS JOIN dbo.AvgQ13 CROSS JOIN dbo.AvgQ26 /*the rest of views that i joined*/
WHERE (dbo.AvgQ26.LeaderID = @leader) AND (dbo.AvgQ26.Rater = 'Team Leader')
</pre>
but thanks for ur assistance i think im goin 2 rewrite so that my sproc use scalar functions lyk u have done because it looks much cleaner than not using them.
2gizzo
4-Oct-10 12:49pm
View
Re-implemeted the select statement as scalar function and then i call them from the sproc but its still giving me the same results, that is only the first function (in this case) is being listed as column 1 the rest still cant be seen.
2gizzo
3-Oct-10 4:13am
View
Initially i had seperate sproc but it seems tht report viewer can only let me choose one SP/table/view per report thats when i decided to create one sproc for all of them. Using a view wud be great solution but they cant accept parameters to be passed to them at runtime. Can u give me an example of how i can write a single query that would cater for both statements?
Show More