15,894,405 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 earloc (Top 40 by date)
earloc
24-Jun-14 4:29am
View
what type is "screenFields"? Is is some sort of ObservalbeCollection<t> / INotifyCollectionChanged? If so, every single record would result in a change to the UI. Consider loading all records "off screen" and set the collection once it finished loading. Or use some sortof "DataVirtualization"-approach. just feed your favorite search-engine (e.G. https://datavirtualization.codeplex.com/ or http://msdn.microsoft.com/en-us/library/cc716879(v=vs.110).aspx)
nevertheless, i agree with the other folks that it sounds like a general design-issue rather than a "real" performance bottleneck.
earloc
14-Mar-13 7:41am
View
What Type are the elements of the AllTypes Collection?
Is it of Type "System.Type"? Then your are calling Type.GetTypes()-Method with too few information.
The "Name"-Property of the "System.Type"-Class only contains the TypeName (e.g. "String"), while the "FullName"-Property contains also information about the Namespace (e.g. "System.String")
The "AssemblyQualifiedName"-Propertty contains information about AssemlbyName, AssemblyVersion, AssemlbyCulture and PublicKeyToken
(e.g. "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")
Given only the Name part of the Type, the TypeSystem won´t be able to find it, as it lacks at least the namespace-portion.
earloc
14-Mar-13 7:30am
View
have you tried to compile your solution with target platform "x86" instead of "any cpu"?
earloc
13-Mar-13 9:54am
View
Yes it is!
earloc
7-Mar-13 8:10am
View
i totally agree! (too said we can´t vote up comments ;) )
earloc
5-Mar-13 9:21am
View
which line causes your app to hang?
earloc
4-Mar-13 3:08am
View
way too few details...improve your question and specify what you have tried so far and what exactly you are trying to do!
earloc
4-Mar-13 3:06am
View
you´re welcome ;)
earloc
20-Feb-13 9:14am
View
plz post your ServiceContract-Interface, ServiceImplementation-Class and web.config.
earloc
20-Feb-13 9:09am
View
smells like homework...what have you tried so far?
earloc
19-Feb-13 7:31am
View
you´re on the right way.
Define a class "User" with public properties "Username", "Password", "Gender".
modify the "List" stored in variable listPost in your above example to hold instances of this class.
for each record in the resulting DataSet, instantiate a new Instance of "User" class, setting the Properties according to the corresponding Cell of your DataRow.
Add these new instances to the List (which result in setting the ItemsSource-Property of the ListView.
Modify the Bindings in your DataTemplate to match the "User"-classes propertynames (case sensitive).
Add Eyecandy to your DataTemplate so it looks like the example you posted in the pic
earloc
24-Jan-13 4:30am
View
yeah, just noticed the BindingFlag :)
earloc
24-Jan-13 4:28am
View
you try to invoke a method on "Nothing (null in C#)"..no wonder this throws a NullReferenceException...
btw: really bad variable naming. you should always use names that actually make sense...
earloc
20-Dec-12 4:59am
View
what line is causing the Exception? could only be trying to get the enumerator for "Model" or accessing the "Name"-Property of a null reference in "genre"
earloc
20-Dec-12 4:46am
View
I'll see if i can manage to improve the solution, providing a more detailed sample on how to accomplish this. Nevertheless i recommend to bind the TreeView's SelectedItem-Property to a appropriate ViewModel-Property, as this would drastically reduce the coding needed compared to the other approach.
btw: your xaml-snippet is missing a binding to the IsSelected property of your dataitem...you provide a style for the TreeView's ItemContainerStyle but don't have any setters in it!
earloc
8-Dec-12 15:41pm
View
already got a look at
http://msdn.microsoft.com/en-us/library/system.windows.controls.virtualizingstackpanel.aspx
?
btw: what technology? WinForms/WPF?
earloc
29-Nov-12 3:43am
View
it depends on the implementation of sampledbDSTableAdapters.productTableAdapter.Insert - method
if it is generated, then it most likely will make use of SqlParameters to "inject" your provided values into the Insert-SqlStatement - and therfore should prevent most of the common SqlInjection scenarios.
earloc
29-Nov-12 3:33am
View
it's nice of you keeping the detail of your problem as low as possible, but no one will ever possibly can give you a direction to look at if you don't supply more information (e.g. your configuration, exception-details like a stacktrace, etc.)
from those information-bits that you provided, it seemed as if your configuration-file is sort of messed up...
earloc
29-Nov-12 3:25am
View
Ok, that sure seems weird. But the complete Drag&Drop behavior is a chapter of it's own since the beginning...WPF, sadly, does nothing to make this event-hazzle a bit more programmer friendlier (at least not OOTB).
I would check if the DragDropEffect your are setting is supported by the Lync-Drag operation (e.g. by examining the AllowedEffects-property of the DragEventArgs).
Also try to hookup to the GiveFeedback-event.
Sorry i can't help more on this issue.
earloc
28-Nov-12 17:47pm
View
Hey!
I provided a second solution...hope it clarifies things up! ;)
earloc
28-Nov-12 10:18am
View
Give me some time and i'll see if can wire up a sample for you. I'm a little bit busy right now...;)
earloc
28-Nov-12 5:53am
View
sorry, but this is such a basic concept...i think you should read about classes (types) and instances. once you have done that, you will be able to solve your issue by yourself! (hint: you should pass an existing instance of Form1 to a new instance of Form2 using either a constructor or a property...)
if i misunderstood your question, please dont hesitate refining your question to a more specific problem.
http://en.wikipedia.org/wiki/Class_(computer_programming)
earloc
23-Nov-12 8:02am
View
as you are facing case 2.), i asume that you have a web.config at web-SITE level and one on application-level. check, if there are add-Elements with the same name in it
earloc
23-Nov-12 8:00am
View
strange behavior...sure, this would be a workaround for the lack of lambda-support. but how do you pass in the variables to "Lambda1" when the "Albert"-string is not a constant without introducing new fields (which would mimic the Closure in a minimalistic way)?
i´m suprised that my original solution does not work for you, as i did not encounter any problems with VS2010 / VB.NET 10.0 (even on .NET 2.0)
earloc
23-Nov-12 5:39am
View
you´re welcome! glad could´ve helped you!
earloc
23-Nov-12 5:31am
View
You don´t have to define the Action<t1,> delegate, if you are using .NET 3.5.
And even if you had to, i could not answer this question, as it depends on your project´s structure and architecture...
Just make sure that it can bee "seen" by the calling site ;)
mayby try out the VS2008 (VB.NET 9.0) fallback that i provided, as the error message you are facing implies that you are using VS2008.
earloc
23-Nov-12 4:55am
View
see my improved solution! are you using VS2008 / .NET 2.0 ?
earloc
23-Nov-12 4:36am
View
1. Sub Main() is just a sample that demonstrates the usage of this pattern.
2. the "location" of "ExecuteWithinTransaction" depends on your architecture...maybe it can be integrated in your SqlDatabase-class for general purpose.
3. The additional parameters would do the trick, even though this pattern can be more generalized in order to get less verbose method-signatures.
if it helped, please rate and mark the question as solved!
earloc
23-Nov-12 3:50am
View
everytime you build an sql-command using string concatination you open up your application for possible sql-injection. It seems to me that you are using a custom "framework" for building your queries and i dont know how the method "AddInParameter" is implemented in detail - i assume for know that it uses standard SQL-Parameter to prevent SQL-Injection.
you should always build your commands like:
var commandString = "Insert into XXX (ColumnA, COlumnB) VALUES (@ColumnA, @ColumnB)";
var cmd = new SqlCommand(commandString, connection);
cmd.Parameters.AddWithValue ("@ColumnA", 123); //or a similar approach to "replace" those parameters.
in this way,, the SQLServer can "precompile" the statement and "inject" the parametervalues by itself and check, if the overall command gets broken (by ensuring the dataType of the parameter, etc)
when you build up your statement like:
var cmd = new SqlCommand("INSERT INTO XXX (ColumnA) VALUES ('" + columnA +"' +);
columnA may be defined as "A'); DROP TABLE XXX; --", resulting in a command like:
INSERT INTO XXX (ColumnA) VALUES ('A'); DROP TABLE XXX; --');
even if chances are low that this will actually be exploited(e.g. because the parameter you are concatinating is not provided by direct user input or SqlServer does detecting thos malicious queries), at least the possibility remains, what almost always is a bad code smell.
In your solution, this happens with the "Gender" Parameter in "createNewAccID" and "accID " in "insertIntoMandatorySteps"
Edit1: Codesamples are C#-syntax
earloc
23-Nov-12 2:47am
View
what do you mean with "apply transaction when calling the functions"? can you provide more details about your purpose?
BTW: are you aware of the possible sql-injection in your solution?
earloc
21-Nov-12 6:37am
View
Your welcome, see my provided solution as a possible start to solving your problem
earloc
21-Nov-12 3:45am
View
i think nobody really understands what you are trying do achieve nor what your problem is...try to provide more details about your intensions and what the code should actual do!
earloc
21-Nov-12 2:54am
View
your sample is missing definition of
field "m_transform" and method "GetMatrix"
earloc
20-Nov-12 16:59pm
View
where do you get what type of exception?
nevertheless, if you have mapping code (Migrate32BitsStructTo64BitsStruct), why do you stick to a solution using reflection rather than copying those three values by hand, like:
struct32bits source;
struct64bits target;
target.lVersionNumber = Convert.ToInt64(source.lVersionNumber);
etc...
(i think, but am not sure, that is what SA suggested?!)
earloc
20-Nov-12 13:49pm
View
what should the timer do? just keep track of the elapsed time?
earloc
20-Nov-12 9:32am
View
DllImport (System.Runtime.InteropServices.DllImportAttribute) is defined in mscorlib.dll. make sure you add a using directive to its namespace:
using System.Runtime.InteropService;
refer to http://msdn.microsoft.com/en-US/library/system.runtime.interopservices.dllimportattribute.aspx
and remember: MSDN is your friend :)
earloc
20-Nov-12 8:53am
View
the output gives
[DllImport("user32.dll", EntryPoint="SendMessageA")]
private static extern int SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
earloc
19-Nov-12 8:59am
View
please tell us more about your intensions to do this!
1.) do you want an array of instances of a generic type?
2.) or a generic List which elements are Arrays of a type?
earloc
19-Nov-12 8:21am
View
you need to execute those commands under full administrative privileges. make sure you start your command line "as administrator". does this solve the issue?
earloc
19-Nov-12 7:35am
View
what technology are you using? ASP.NET? WPF? WinForms?
Show More